Skip to content

Commit

Permalink
Merge pull request #31 from modelcontextprotocol/justin/fix-missing-e…
Browse files Browse the repository at this point in the history
…rror-code

Fix missing error codes
  • Loading branch information
jspahrsummers authored Nov 1, 2024
2 parents 3d39ca6 + a8b61c3 commit 9b4c949
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/shared/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down

0 comments on commit 9b4c949

Please sign in to comment.