Fix bug with default error code in jsonrpc exceptions

Change-Id: I8cdab28467b5b3e0fb673ba7d0ac5506386108b1