diff --git a/packages/json-rpc-engine/src/JsonRpcEngine.ts b/packages/json-rpc-engine/src/JsonRpcEngine.ts index bf4beaf32b..3cc4fbbd4f 100644 --- a/packages/json-rpc-engine/src/JsonRpcEngine.ts +++ b/packages/json-rpc-engine/src/JsonRpcEngine.ts @@ -277,8 +277,7 @@ export class JsonRpcEngine extends SafeEventEmitter { return handlerCallback(); }); } catch (error) { - // TODO: Explicitly handle errors thrown from `#runAllMiddleware` that are not of type `JsonRpcEngineCallbackError` - return end(error as JsonRpcEngineCallbackError); + return end(error); } }; } @@ -600,8 +599,7 @@ export class JsonRpcEngine extends SafeEventEmitter { try { middleware(request, response, next, end); } catch (error) { - // TODO: Explicitly handle errors thrown from `middleware` that are not of type `JsonRpcEngineCallbackError` - end(error as JsonRpcEngineCallbackError); + end(error); } }); } diff --git a/packages/json-rpc-engine/src/createAsyncMiddleware.ts b/packages/json-rpc-engine/src/createAsyncMiddleware.ts index 084190959e..a24b607e4a 100644 --- a/packages/json-rpc-engine/src/createAsyncMiddleware.ts +++ b/packages/json-rpc-engine/src/createAsyncMiddleware.ts @@ -90,8 +90,7 @@ export function createAsyncMiddleware< if (returnHandlerCallback && error instanceof Error) { (returnHandlerCallback as ReturnHandlerCallback)(error); } else { - // TODO: Explicitly handle errors thrown from `#runReturnHandlers` that are not of type `JsonRpcEngineCallbackError` - end(error as JsonRpcEngineCallbackError); + end(error); } } };