Comparing version 0.6.1 to 0.6.2
@@ -206,13 +206,18 @@ "use strict"; | ||
const error = RpcResponse.parseErrorObject(errorObject_); | ||
if (error instanceof RpcResponse.BaseError) { | ||
if (error.code === DisconnectedError.code) | ||
if (error instanceof RpcResponse.InternalError) { | ||
const { code } = error.data; | ||
if (code === DisconnectedError.code) | ||
return new DisconnectedError(errorObject_); | ||
if (error.code === ChainDisconnectedError.code) | ||
if (code === ChainDisconnectedError.code) | ||
return new ChainDisconnectedError(errorObject_); | ||
if (error.code === UserRejectedRequestError.code) | ||
if (code === UserRejectedRequestError.code) | ||
return new UserRejectedRequestError(errorObject_); | ||
if (error.code === UnauthorizedError.code) | ||
if (code === UnauthorizedError.code) | ||
return new UnauthorizedError(errorObject_); | ||
if (error.code === UnsupportedMethodError.code) | ||
if (code === UnsupportedMethodError.code) | ||
return new UnsupportedMethodError(errorObject_); | ||
return new RpcResponse.InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}); | ||
} | ||
@@ -219,0 +224,0 @@ return error; |
@@ -51,3 +51,6 @@ "use strict"; | ||
return new VersionNotSupportedError(errorObject_); | ||
return new BaseError(errorObject_); | ||
return new InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}); | ||
} | ||
@@ -378,3 +381,3 @@ class BaseError extends Error { | ||
writable: true, | ||
value: 'RpcResponse.InternalErrorError' | ||
value: 'RpcResponse.InternalError' | ||
}); | ||
@@ -381,0 +384,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '0.6.1'; | ||
exports.version = '0.6.2'; | ||
//# sourceMappingURL=version.js.map |
@@ -252,13 +252,18 @@ import { EventEmitter } from 'eventemitter3'; | ||
const error = RpcResponse.parseErrorObject(errorObject_); | ||
if (error instanceof RpcResponse.BaseError) { | ||
if (error.code === DisconnectedError.code) | ||
if (error instanceof RpcResponse.InternalError) { | ||
const { code } = error.data; | ||
if (code === DisconnectedError.code) | ||
return new DisconnectedError(errorObject_); | ||
if (error.code === ChainDisconnectedError.code) | ||
if (code === ChainDisconnectedError.code) | ||
return new ChainDisconnectedError(errorObject_); | ||
if (error.code === UserRejectedRequestError.code) | ||
if (code === UserRejectedRequestError.code) | ||
return new UserRejectedRequestError(errorObject_); | ||
if (error.code === UnauthorizedError.code) | ||
if (code === UnauthorizedError.code) | ||
return new UnauthorizedError(errorObject_); | ||
if (error.code === UnsupportedMethodError.code) | ||
if (code === UnsupportedMethodError.code) | ||
return new UnsupportedMethodError(errorObject_); | ||
return new RpcResponse.InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}); | ||
} | ||
@@ -265,0 +270,0 @@ return error; |
@@ -154,3 +154,6 @@ // eslint-disable-next-line jsdoc/require-jsdoc | ||
return new VersionNotSupportedError(errorObject_); | ||
return new BaseError(errorObject_); | ||
return new InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}); | ||
} | ||
@@ -482,3 +485,3 @@ /** Thrown when a JSON-RPC error has occurred. */ | ||
writable: true, | ||
value: 'RpcResponse.InternalErrorError' | ||
value: 'RpcResponse.InternalError' | ||
}); | ||
@@ -485,0 +488,0 @@ } |
/** @internal */ | ||
export const version = '0.6.1'; | ||
export const version = '0.6.2'; | ||
//# sourceMappingURL=version.js.map |
@@ -286,3 +286,3 @@ import type { Errors, RpcRequest } from '../index.js'; | ||
readonly code = -32603; | ||
readonly name = "RpcResponse.InternalErrorError"; | ||
readonly name = "RpcResponse.InternalError"; | ||
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>); | ||
@@ -289,0 +289,0 @@ } |
/** @internal */ | ||
export declare const version = "0.6.1"; | ||
export declare const version = "0.6.2"; | ||
//# sourceMappingURL=version.d.ts.map |
# ox | ||
## 0.6.2 | ||
### Patch Changes | ||
- [`e541cec`](https://github.com/wevm/ox/commit/e541ceca3c00f0d0b2fbd239696476934dc13ea3) Thanks [@jxom](https://github.com/jxom)! - Modified fallback RPC Errors to `RpcResponse.InternalError`. | ||
## 0.6.1 | ||
@@ -4,0 +10,0 @@ |
@@ -437,13 +437,18 @@ import { EventEmitter } from 'eventemitter3' | ||
const error = RpcResponse.parseErrorObject(errorObject_) | ||
if (error instanceof RpcResponse.BaseError) { | ||
if (error.code === DisconnectedError.code) | ||
if (error instanceof RpcResponse.InternalError) { | ||
const { code } = error.data as RpcResponse.ErrorObject | ||
if (code === DisconnectedError.code) | ||
return new DisconnectedError(errorObject_) as never | ||
if (error.code === ChainDisconnectedError.code) | ||
if (code === ChainDisconnectedError.code) | ||
return new ChainDisconnectedError(errorObject_) as never | ||
if (error.code === UserRejectedRequestError.code) | ||
if (code === UserRejectedRequestError.code) | ||
return new UserRejectedRequestError(errorObject_) as never | ||
if (error.code === UnauthorizedError.code) | ||
if (code === UnauthorizedError.code) | ||
return new UnauthorizedError(errorObject_) as never | ||
if (error.code === UnsupportedMethodError.code) | ||
if (code === UnsupportedMethodError.code) | ||
return new UnsupportedMethodError(errorObject_) as never | ||
return new RpcResponse.InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}) as never | ||
} | ||
@@ -450,0 +455,0 @@ return error as never |
@@ -313,3 +313,6 @@ import type { Errors, RpcRequest } from '../index.js' | ||
return new VersionNotSupportedError(errorObject_) as never | ||
return new BaseError(errorObject_) as never | ||
return new InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}) as never | ||
} | ||
@@ -573,3 +576,3 @@ | ||
override readonly code = -32603 | ||
override readonly name = 'RpcResponse.InternalErrorError' | ||
override readonly name = 'RpcResponse.InternalError' | ||
@@ -576,0 +579,0 @@ constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) { |
{ | ||
"name": "ox", | ||
"description": "Ethereum Standard Library", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"main": "./_cjs/index.js", | ||
@@ -6,0 +6,0 @@ "module": "./_esm/index.js", |
/** @internal */ | ||
export const version = '0.6.1' | ||
export const version = '0.6.2' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5083778
95578