From 531f2104c93734615310f24b3962316e944ea2d8 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Thu, 20 Jun 2019 14:57:00 +0100 Subject: [PATCH] refactors rpc_errors and defines internal errors --- pisa-btc/pisa/errors.py | 13 +++++++++++++ pisa-btc/pisa/responder.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 pisa-btc/pisa/errors.py diff --git a/pisa-btc/pisa/errors.py b/pisa-btc/pisa/errors.py new file mode 100644 index 0000000..59fec70 --- /dev/null +++ b/pisa-btc/pisa/errors.py @@ -0,0 +1,13 @@ +# Appointment errors +APPOINTMENT_EMPTY_FIELD = -1 +APPOINTMENT_WRONG_FIELD_TYPE = -2 +APPOINTMENT_WRONG_FIELD_SIZE = -3 +APPOINTMENT_WRONG_FIELD_FORMAT = -4 +APPOINTMENT_FIELD_TOO_SMALL = -5 +APPOINTMENT_FIELD_TOO_BIG = -6 +APPOINTMENT_WRONG_FIELD = -7 +APPOINTMENT_CIPHER_NOT_SUPPORTED = -8 +APPOINTMENT_HASH_FUNCTION_NOT_SUPPORTED = -9 + + + diff --git a/pisa-btc/pisa/responder.py b/pisa-btc/pisa/responder.py index 5cb5c1d..7a12bd5 100644 --- a/pisa-btc/pisa/responder.py +++ b/pisa-btc/pisa/responder.py @@ -1,7 +1,7 @@ from queue import Queue from threading import Thread from pisa.zmq_subscriber import ZMQHandler -from pisa.errors import * +from pisa.rpc_errors import * from utils.authproxy import AuthServiceProxy, JSONRPCException from conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT