Skip to content

Commit 416a4e8

Browse files
committed
Fix wrong error codes, Fix typo in tests
1 parent 2a64999 commit 416a4e8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/core.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ const INVALID_REQUEST = -32600
3636
3737
The method does not exist / is not available.
3838
"""
39-
const METHOD_NOT_FOUND = -32700
39+
const METHOD_NOT_FOUND = -32601
4040

4141
"""
4242
INVALID_PARAMS
4343
4444
Invalid method parameter(s).
4545
"""
46-
const INVALID_PARAMS = -32700
46+
const INVALID_PARAMS = -32602
4747

4848
"""
4949
INTERNAL_ERROR
5050
5151
Internal JSON-RPC error.
5252
"""
53-
const INTERNAL_ERROR = -32700
53+
const INTERNAL_ERROR = -32603
5454

5555
"""
5656
RPCErrorStrings
@@ -67,6 +67,8 @@ const RPCErrorStrings = Base.IdDict(
6767
INTERNAL_ERROR => "InternalError",
6868
[ i => "ServerError" for i in -32099:-32000]...,
6969
# TODO: these should be removed - they are in the application/implementation specific range
70+
-32000 => "serverErrorEnd",
71+
-32099 => "serverErrorStart",
7072
-32002 => "ServerNotInitialized",
7173
-32001 => "UnknownErrorCode",
7274
-32800 => "RequestCancelled",

test/test_core.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
@test sprint(showerror, JSONRPC.JSONRPCError(-32001, "FOO", "BAR")) == "UnknownErrorCode: FOO (BAR)"
1111
@test sprint(showerror, JSONRPC.JSONRPCError(-32800, "FOO", "BAR")) == "RequestCancelled: FOO (BAR)"
1212
@test sprint(showerror, JSONRPC.JSONRPCError(-32801, "FOO", "BAR")) == "ContentModified: FOO (BAR)"
13-
@test sprint(showerror, JSONRPC.JSONRPCError(1, "FOO", "BAR")) == "Unkonwn: FOO (BAR)"
13+
@test sprint(showerror, JSONRPC.JSONRPCError(1, "FOO", "BAR")) == "Unknown: FOO (BAR)"
1414
end

0 commit comments

Comments
 (0)