Merge pull request #31 from modelcontextprotocol/justin/fix-missing-error-code

Fix missing error codes
This commit is contained in:
Justin Spahr-Summers 2024-11-01 15:57:31 +00:00 • committed by GitHub
commit 9b4c949f65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/sdk",
"version": "0.1.0",
"version": "0.1.1",
"description": "Model Context Protocol implementation for TypeScript",
"type": "module",
"main": "./dist/index.js",

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",
},