Skip to content

Commit

Permalink
Handle error code for invalid params
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Apr 9, 2017
1 parent 27fa272 commit 3e9bda2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions device.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const IDENTITY_MAPPER = v => v;

const ERRORS = {
'-5001': (method, args, err) => err.message == 'invalid_arg' ? 'Invalid argument' : err.message,
'-5005': (method, args, err) => err.message == 'params error' ? 'Invalid argument' : err.message,
'-10000': (method) => 'Method `' + method + '` is not supported'
};

Expand Down

0 comments on commit 3e9bda2

Please sign in to comment.