Fix missing error codes

This commit is contained in:
Justin Spahr-Summers 2024-11-01 14:47:43 +00:00
commit a254ab7e46
No known key found for this signature in database

View file

@ -180,8 +180,8 @@ export class Protocol<
jsonrpc: "2.0",
id: request.id,
error: {
code: error["code"]
? Math.floor(Number(error["code"]))
code: Number.isSafeInteger(error["code"])
? error["code"]
: ErrorCode.InternalError,
message: error.message ?? "Internal error",
},