errors.py (1580B)
1 #!/usr/bin/env python3 2 # Copyright (C) 2020-2021 Ivan J. <parazyd@dyne.org> 3 # 4 # This file is part of obelisk 5 # 6 # This program is free software: you can redistribute it and/or modify 7 # it under the terms of the GNU Affero General Public License version 3 8 # as published by the Free Software Foundation. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Affero General Public License for more details. 14 # 15 # You should have received a copy of the GNU Affero General Public License 16 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 """JSON-RPC errors 18 https://www.jsonrpc.org/specification#error_object 19 """ 20 21 ERRORS = { 22 "invalidparams": { 23 "error": { 24 "code": -32602, 25 "message": "invalid parameters" 26 } 27 }, 28 "internalerror": { 29 "error": { 30 "code": -32603, 31 "message": "internal error" 32 } 33 }, 34 "parseerror": { 35 "error": { 36 "code": -32700, 37 "message": "parse error" 38 } 39 }, 40 "invalidrequest": { 41 "error": { 42 "code": -32600, 43 "message": "invalid request" 44 } 45 }, 46 "nomethod": { 47 "error": { 48 "code": -32601, 49 "message": "method not found" 50 } 51 }, 52 "protonotsupported": { 53 "error": { 54 "code": -32100, 55 "message": "client protocol version is not supported", 56 } 57 }, 58 }