Skip to content

Releases: MetaMask/rpc-errors

5.1.1

19 Apr 09:53
af3ef43
Compare
Choose a tag to compare

Fixed

  • Allow passing unknown values as cause (#91)
    • Prevously, only Error instances were allowed, but any value can be thrown as error

5.1.0

18 Apr 11:52
1d1852d
Compare
Choose a tag to compare

Added

  • Allow passing a cause to predefined error functions (#83)
    • This allows passing an Error instance as cause, by using { data: { cause: /* some error */ } }
    • The error will be properly serialised when calling serialize

5.0.0

12 Apr 12:18
7471a50
Compare
Choose a tag to compare

Changed

  • BREAKING: Bump minimum version to Node 16 (#68)
  • BREAKING: Rewrite error serialization (#61)
    • Allows errors that conform to the JsonRpcError type
    • If errors don't conform to the type, the error will be wrapped in an internal error and the original error will be available as data.cause
  • BREAKING: Rename exports to be more generic (#75)
    • JSON-RPC errors and Ethereum EIP-1474 errors are namespaced under "rpcErrors"
    • Ethereum EIP-1193 Provider errors are namespaced under "providerErrors"
  • BREAKING: Target ES2020 (#77)
  • Rename package to @metamask/rpc-errors (#67)

4.0.3

11 Mar 05:25
a41b1cc
Compare
Choose a tag to compare

Fixed

  • Correctly type ethErrors getter function argument objects as optional (#36)

4.0.2

11 Mar 05:13
2a699eb
Compare
Choose a tag to compare

Changed

  • The data property of EthereumRpcError and EthereumProviderError is now marked as optional rather than T | undefined (#34)

Fixed

  • SerializedEthereumRpcError.stack is now correctly typed as a string, if present (#34)

4.0.1

11 Mar 05:12
d1a4a9f
Compare
Choose a tag to compare

Changed

  • Updated README.md (#30)

4.0.0

03 Nov 00:55
b83d06c
Compare
Choose a tag to compare

Changed

  • BREAKING: ERROR_CODES export renamed to errorCodes (#28)
  • BREAKING: ethErrors getters will now throw an error if passed a truthy, non-string message (#28)
  • Updated TypeScript types for all exports (#28)

3.0.0

03 Nov 00:10
62b5ff7
Compare
Choose a tag to compare

Changed

  • BREAKING: Second argument of serializeError is now an options object (#22)
  • Error stacks are no longer serialized by default by serializeError (#22)

2.1.1

03 Nov 00:13
e5f4991
Compare
Choose a tag to compare
  • Prevent unnecessary files from being published (#17)

2.1.0

03 Nov 00:26
1275c42
Compare
Choose a tag to compare
  • Add new/missing errors:
    • ethErrors.provider (EIP-1193)
      • .disconnected, 4900
      • .chainDisconnected, 4901
    • ethErrors.rpc (EIP-1474)
      • .limitExceeded, -32005