mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 06:48:00 +01:00
16 lines
521 B
Python
16 lines
521 B
Python
from datetime import datetime
|
|
|
|
TS_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
|
|
|
|
|
|
class BlitzError(Exception):
|
|
def __init__(self, short: str, details: dict = None, org: Exception = None):
|
|
self.short: str = str(short)
|
|
if details:
|
|
self.details: dict = details
|
|
self.details.update({'timestamp': datetime.utcnow().strftime(TS_FORMAT)})
|
|
else:
|
|
self.details = dict()
|
|
self.details['timestamp'] = datetime.utcnow().strftime(TS_FORMAT)
|
|
|
|
self.org: Exception = org
|