Merge "Allow specify log level for Error exception"
This commit is contained in:
commit
aea60cdc4a
@ -103,9 +103,9 @@ LOG = getProcessingLogger(__name__)
|
|||||||
class Error(Exception):
|
class Error(Exception):
|
||||||
"""Inspector exception."""
|
"""Inspector exception."""
|
||||||
|
|
||||||
def __init__(self, msg, code=400, **kwargs):
|
def __init__(self, msg, code=400, log_level='error', **kwargs):
|
||||||
super(Error, self).__init__(msg)
|
super(Error, self).__init__(msg)
|
||||||
LOG.error(msg, **kwargs)
|
getattr(LOG, log_level)(msg, **kwargs)
|
||||||
self.http_code = code
|
self.http_code = code
|
||||||
|
|
||||||
|
|
||||||
@ -113,7 +113,8 @@ class NotFoundInCacheError(Error):
|
|||||||
"""Exception when node was not found in cache during processing."""
|
"""Exception when node was not found in cache during processing."""
|
||||||
|
|
||||||
def __init__(self, msg, code=404):
|
def __init__(self, msg, code=404):
|
||||||
super(NotFoundInCacheError, self).__init__(msg, code)
|
super(NotFoundInCacheError, self).__init__(msg, code,
|
||||||
|
log_level='info')
|
||||||
|
|
||||||
|
|
||||||
def executor():
|
def executor():
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
other:
|
||||||
|
- Log level for error when node was not found in Inspector cache was
|
||||||
|
changed from error to info level. It was done because not_found_hook
|
||||||
|
may handle this case, so this wouldn't be error anymore.
|
Loading…
x
Reference in New Issue
Block a user