comparison sat/plugins/plugin_comp_ap_gateway/http_server.py @ 3996:7a6c7abd7dbb

component AP gateway (http_server): use log.exception instead of log.error
author Goffi <goffi@goffi.org>
date Thu, 02 Mar 2023 12:39:16 +0100
parents 27e5294649c2
children 54a6b44f173b
comparison
equal deleted inserted replaced
3995:27e5294649c2 3996:7a6c7abd7dbb
76 if msg is not None: 76 if msg is not None:
77 log.warning(msg) 77 log.warning(msg)
78 request.setResponseCode(http_code, None if msg is None else msg.encode()) 78 request.setResponseCode(http_code, None if msg is None else msg.encode())
79 79
80 def _onRequestError(self, failure_: failure.Failure, request: "HTTPRequest") -> None: 80 def _onRequestError(self, failure_: failure.Failure, request: "HTTPRequest") -> None:
81 log.error(f"Internal error: {failure_.value}") 81 log.exception(f"Internal error: {failure_.value}")
82 self.responseCode( 82 self.responseCode(
83 request, 83 request,
84 http.INTERNAL_SERVER_ERROR, 84 http.INTERNAL_SERVER_ERROR,
85 f"internal error: {failure_.value}" 85 f"internal error: {failure_.value}"
86 ) 86 )