teos - moves errors to common so it can be used by clients

This commit is contained in:
Sergi Delgado Segura
2020-04-29 13:03:39 +02:00
parent 9f2c90d12e
commit 88c19d5a0d
6 changed files with 6 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ import logging
from flask import Flask, request, abort, jsonify
from teos import LOG_PREFIX
import teos.errors as errors
import common.errors as errors
from teos.inspector import InspectionFailed
from teos.watcher import AppointmentLimitReached
from teos.gatekeeper import NotEnoughSlots, AuthenticationFailure

View File

@@ -3,7 +3,7 @@ from common.logger import Logger
from teos.tools import bitcoin_cli
import teos.rpc_errors as rpc_errors
from teos.utils.auth_proxy import JSONRPCException
from teos.errors import UNKNOWN_JSON_RPC_EXCEPTION, RPC_TX_REORGED_AFTER_BROADCAST
from common.errors import UNKNOWN_JSON_RPC_EXCEPTION, RPC_TX_REORGED_AFTER_BROADCAST
logger = Logger(actor="Carrier", log_name_prefix=LOG_PREFIX)

View File

@@ -1,21 +0,0 @@
# Appointment errors [-1, -32]
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_INVALID_SIGNATURE_OR_INSUFFICIENT_SLOTS = -8
# Registration errors [-33, -64]
REGISTRATION_MISSING_FIELD = -33
REGISTRATION_WRONG_FIELD_FORMAT = -34
# General errors [-65, -96]
INVALID_REQUEST_FORMAT = -65
# Custom RPC errors [255+]
RPC_TX_REORGED_AFTER_BROADCAST = -256
# UNHANDLED
UNKNOWN_JSON_RPC_EXCEPTION = -257

View File

@@ -4,7 +4,8 @@ from common.logger import Logger
from common.tools import is_locator
from common.constants import LOCATOR_LEN_HEX
from teos import errors, LOG_PREFIX
from teos import LOG_PREFIX
from common import errors
from teos.extended_appointment import ExtendedAppointment
logger = Logger(actor="Inspector", log_name_prefix=LOG_PREFIX)