mirror of https://github.com/veops/cmdb.git
17 lines
440 B
Python
17 lines
440 B
Python
# -*- coding:utf-8 -*-
|
|
|
|
|
|
class InvalidUsageError(Exception):
|
|
status_code = 400
|
|
|
|
def __init__(self, message, status_code=None, payload=None):
|
|
Exception.__init__(self)
|
|
self.message = message
|
|
if status_code is not None:
|
|
self.status_code = status_code
|
|
self.payload = payload
|
|
|
|
def to_dict(self):
|
|
rv = dict(self.payload or ())
|
|
rv['message'] = self.message
|
|
return rv |