exceptions.py
323 Bytes
from io import StringIO
import traceback
def exception_message():
with StringIO() as f:
traceback.print_exc(file=f)
return f.getvalue()
class BaseError(Exception):
def __init__(self, code, message, action=''):
self.code = code
self.message = message
self.action = action