All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bump
@metamask/utilsfrom^11.0.1to^11.4.2(#171)
- Bump
@metamask/utilsfrom^10.0.0to^11.0.1(#166)
- Bump
@metamask/utilsfrom^9.0.0to^10.0.0(#161)
- BREAKING: Preserve original messages during error serialization by default (#158)
- The behavior introduced in
5.0.0of overwriting the original message is available by passingshouldPreserveMessage: falsetoserializeError().
- The behavior introduced in
- BREAKING: Bump minimum Node.js version from 16 to 18 (#154)
- Migrate to
ts-bridge(#152)- Migrates to ts-bridge from
tsup, which may resolve issues when importing this package in CommonJS or ESM.
- Migrates to ts-bridge from
- Bump
@metamask/utilsfrom^8.3.0to^9.0.0(#147)
- Expose error causes as
causeproperty (#140)JsonRpcErrorobjects already had a.data.causeproperty. It is now exposed as.causein order to to be recognized as ES Causes.
- Export
OptionalDataWithOptionalCausetype (#135)
- Add ESM build (#133)
- Update
@metamask/utilsfrom^8.1.0to^8.3.0(#133)
- Update dependency
@metamask/utilsfrom^8.0.0to^8.1.0(#108)
- Exclude
dist/__fixtures__files from published package (#114)
- Make Data type-parameter optional in JsonRpcError (#102)
- BREAKING:
undefinedis now not recognized as valid JSON value- Update dependency
@metamask/utilsfrom^5.0.0to^8.0.0(#101)
- Update dependency
- Allow passing unknown values as cause (#91)
- Prevously, only
Errorinstances were allowed, but any value can be thrown as error
- Prevously, only
- Allow passing a cause to predefined error functions (#83)
- This allows passing an
Errorinstance as cause, by using{ data: { cause: /* some error */ } } - The error will be properly serialised when calling
serialize
- This allows passing an
- BREAKING: Bump minimum version to Node 16 (#68)
- BREAKING: Rewrite error serialization (#61)
- Allows errors that conform to the
JsonRpcErrortype - 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
- Allows errors that conform to the
- 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 - 2021-03-10
- Correctly type
ethErrorsgetter function argument objects as optional (#36)
4.0.2 - 2020-11-17
- Mark the
dataproperty ofEthereumRpcErrorandEthereumProviderErroras optional rather thanT | undefined(#34)
- Correctly type
SerializedEthereumRpcError.stackasstring, if present (#34)
4.0.1 - 2020-11-03
- Updated README.md (#30)
4.0.0 - 2020-11-02
- BREAKING:
ERROR_CODESexport renamed toerrorCodes(#28) - BREAKING:
ethErrorsgetters will now throw an error if passed a truthy, non-stringmessage(#28) - Updated TypeScript types for all exports (#28)
3.0.0 - 2020-07-29
- BREAKING: Second argument of
serializeErroris now an options object (#22) - Error stacks are no longer serialized by default by
serializeError(#22)
2.1.1 - 2020-05-12
- Prevent unnecessary files from being published (#17)
2.1.0 - 2020-05-11
- New/missing errors:
- Rename package to
eth-rpc-errors
2.0.2 - 2020-02-12
- Fix faulty null checks throughout codebase (764832d)
2.0.1 - 2020-01-31
- Error codes in docstrings (5452001)
2.0.0 - 2019-09-26
- Exports
errorsrenamedethErrorsJsonRpcErrorrenamedEthereumRpcErrorEthJsonRpcErrorrenamedEthereumProviderError- It is still a subclass of
EthereumRpcError
- It is still a subclass of
- TypeScript
- Renamed affected interfaces
ethErrors- Added missing
EIP-1474 errors
- Added corresponding codes and messages
- Namespacing
- EIP-1474 (which includes JSON RPC 2.0) errors now namespaced under
ethErrors.rpc- JSON RPC 2.0 errors were formerly under
errors.jsonRpc
- JSON RPC 2.0 errors were formerly under
- EIP-1193 errors now namespaced under
ethErrors.provider- Formerly under
errors.eth
- Formerly under
- EIP-1474 (which includes JSON RPC 2.0) errors now namespaced under
- Most error getters now take a single, optional
optsargument, which is either a string or an object- If a string, it becomes the error message
- If an object, it should have the form:
{ message?: string, data?: any } - Special Cases
ethErrors.rpc.servermust receive a single object of the form:- `{ code: number, message?: string, data?: any }
ethErrors.provider.custommust receive a single of the form:- `{ code: number, message: string, data?: any }
- Added missing
EIP-1474 errors
- TypeScript
- Updated affected interfaces
1.1.0 - 2019-09-16
serializeError- If the object passed to the function has a
.messageproperty, it will preferred over the.messageproperty of the fallback error when creating the returned serialized error object
- If the object passed to the function has a