Skip to content
Snippets Groups Projects
Commit 402806b7 authored by Dan Notestein's avatar Dan Notestein
Browse files

[DLN] JussiInternal errors aren't always an http request, don't try to access...

[DLN]  JussiInternal errors aren't always an http request, don't try to access log_traceback parameter when no http request. Comment out Gerlock's unfinished code that would report timing of a RequestTimeoutError and a ResponseTimeoutError
parent 94a10207
No related branches found
No related tags found
2 merge requests!9finally merge old fixes with master,!7merge changes from hbt4
...@@ -127,7 +127,10 @@ class JussiInteralError(Exception): ...@@ -127,7 +127,10 @@ class JussiInteralError(Exception):
self.jsonrpc_request = jrpc_request self.jsonrpc_request = jrpc_request
self.jsonrpc_response = jrpc_response self.jsonrpc_response = jrpc_response
self.exception = exception self.exception = exception
self.log_traceback = http_request.app.config.args.log_traceback if http_request:
self.log_traceback = http_request.app.config.args.log_traceback
else:
self.log_traceback = False
self.logger = error_logger or logger self.logger = error_logger or logger
self.kwargs = kwargs self.kwargs = kwargs
...@@ -271,12 +274,13 @@ class RequestTimeoutError(JsonRpcError): ...@@ -271,12 +274,13 @@ class RequestTimeoutError(JsonRpcError):
def to_dict(self): def to_dict(self):
data = super().to_dict() data = super().to_dict()
try: #Apparently unfinished code, there is no timings() function, should be fixed later I guess
timings = self.timings() #try:
if timings: # timings = self.timings()
data.update(**timings) # if timings:
except Exception as e: # data.update(**timings)
logger.info('error adding timing data to RequestTimeoutError', e=e) #except Exception as e:
# logger.info('error adding timing data to RequestTimeoutError', e=e)
return data return data
...@@ -286,12 +290,13 @@ class ResponseTimeoutError(JsonRpcError): ...@@ -286,12 +290,13 @@ class ResponseTimeoutError(JsonRpcError):
def to_dict(self): def to_dict(self):
data = super().to_dict() data = super().to_dict()
try: #Apparently unfinished code, there is no timings() function, should be fixed later I guess
timings = self.timings() #try:
if timings: # timings = self.timings()
data.update(**timings) # if timings:
except Exception as e: # data.update(**timings)
logger.info('error adding timing data to RequestTimeoutError', e=e) #except Exception as e:
# logger.info('error adding timing data to RequestTimeoutError', e=e)
return data return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment