Merge pull request #160 from jiajunhuang/log
fix the way using logging.exception
This commit is contained in:
commit
93f50b8ef7
|
@ -67,7 +67,7 @@ class Request:
|
||||||
try:
|
try:
|
||||||
self.parsed_json = json_loads(self.body)
|
self.parsed_json = json_loads(self.body)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
log.exception("failed when parsing body as json")
|
||||||
|
|
||||||
return self.parsed_json
|
return self.parsed_json
|
||||||
|
|
||||||
|
@ -88,9 +88,9 @@ class Request:
|
||||||
boundary = parameters['boundary'].encode('utf-8')
|
boundary = parameters['boundary'].encode('utf-8')
|
||||||
self.parsed_form, self.parsed_files = (
|
self.parsed_form, self.parsed_files = (
|
||||||
parse_multipart_form(self.body, boundary))
|
parse_multipart_form(self.body, boundary))
|
||||||
except Exception as e:
|
except Exception:
|
||||||
log.exception(e)
|
log.exception("failed when parsing form")
|
||||||
pass
|
|
||||||
return self.parsed_form
|
return self.parsed_form
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -295,8 +295,7 @@ class Sanic:
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception(
|
log.exception(
|
||||||
'Experienced exception while trying to serve: {}'.format(e))
|
'Experienced exception while trying to serve')
|
||||||
pass
|
|
||||||
|
|
||||||
log.info("Server Stopped")
|
log.info("Server Stopped")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user