UnsupportedErrorclass
new UnsupportedError(message?: string, options: BaseErrorOptions = {})| Param | Type | |
|---|---|---|
message | string | Optional human-readable description of the unsupported functionality. |
options | BaseErrorOptions | Options for BaseError that provide additional helpful error functionality. Defaults to {} |
.caller | AnyCaller | Modify the stack to trim off lines after a certain calling function. |
| Return | |
|---|---|
UnsupportedError | Error thrown when functionality is called but is not supported — by a backend, an environment, or an implementation. |
Error thrown when functionality is called but is not supported — by a backend, an environment, or an implementation.
Thrown when functionality is called but is not supported — a backend that can't run a type of operation (e.g. a key-value store asked to run a query), an environment missing a required capability (e.g. localStorage on the server), or an abstract method left for a subclass to override.
Usage
import { UnsupportedError } from "shelving/error";
class KVProvider {
getQuery(): Promise<Items> {
throw new UnsupportedError("KVProvider does not support querying items");
}
}See shelving/error for shared behaviour — attaching context fields, caller trimming, and catching by type.