@parity/product-sdk-errors
the cross-package SdkError marker for the
@parity/product-sdk family.
This is intentionally separate from the generic @parity/result package:
@parity/result is a domain-agnostic Result primitive (safe to embed
anywhere, including upstream in @parity/truapi), whereas the SdkError
marker below is specific to the @parity/product-sdk error taxonomy.
npm install @parity/product-sdk-errorsExports
Functions
| Name | Summary |
|---|---|
isSdkError() | Check whether a value is any SdkError — i.e. any error raised by an |
Interfaces
| Name | Summary |
|---|---|
SdkError | Structural marker implemented by every @parity/product-sdk-* base error. |
Functions
isSdkError()
Check whether a value is any SdkError — i.e. any error raised by an
@parity/product-sdk-* package.
Answers the cross-cutting “did the SDK raise this?” question in one call,
without importing per-package error classes. For a specific class, use
isErrorOf(e, SomeError) from @parity/result instead.
isSdkError(error: unknown): error is SdkErrorInterfaces
interface SdkError
Structural marker implemented by every @parity/product-sdk-* base error.
Intentionally an interface, not a class: a package implements it by declaring
isSdkError and source on its existing base error, which needs no runtime
dependency on this package (only the type) — so it works even across the
signer → host dependency edge.
Extends: Error
Properties
isSdkError
trueDiscriminant present on all SDK errors.
source
stringThe package that raised the error, e.g. "host", "signer", "contracts".