Skip to content

Commit

Permalink
Client errors have positive codes
Browse files Browse the repository at this point in the history
  • Loading branch information
jsancho-gpl committed Nov 2, 2016
1 parent ddd516b commit 48118ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions nxsugarpy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################

# client errors
# nexus errors
ErrParse = -32700
ErrInvalidRequest = -32600
ErrInternal = -32603
Expand All @@ -35,16 +35,16 @@
ErrInvalidTask = -32002
ErrCancel = -32001
ErrTimeout = -32000
# nxpy errors
ErrUnknownError = -32098
ErrNotSupported = -32099

# nxsugar errors
ErrTestingMethodNotProvided = -20000
ErrPactNotDefined = -20001
ErrTestingMethodNotProvided = 20000
ErrPactNotDefined = 20001

#
ErrStr = {
# client errors
# nexus errors
ErrParse: "Parse error",
ErrInvalidRequest: "Invalid request",
ErrMethodNotFound: "Method not found",
Expand All @@ -60,9 +60,9 @@
ErrTtlExpired: "TTL expired",
ErrLockNotOwned: "Lock not owned",
ErrConnClosed: "Connection is closed",
# nxpy errors
ErrUnknownError: "Unknown error",
ErrNotSupported: "Not supported",

# nxsugar errors
ErrTestingMethodNotProvided: "Testing method not provided",
ErrPactNotDefined: "Pact not defined for provided input",
Expand Down Expand Up @@ -100,4 +100,4 @@ def errToStr(err):

def isNexusErrCode(err, code):
err = formatAsJsonRpcErr(err)
return err["code"] == code
return err["code"] == code
2 changes: 1 addition & 1 deletion nxsugarpy/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,4 +686,4 @@ def wrapped(task):
return res, errm
return f(task)
return f(task)
return wrapped
return wrapped

0 comments on commit 48118ad

Please sign in to comment.