@@ -510,14 +510,21 @@ def on_request( # pylint: disable=too-many-return-statements
510510 log_string += "\n No body was attached to the request"
511511 logger .info (log_string )
512512
513- except Exception as err : # pylint: disable=broad-except
514- logger .warning ("Failed to log request: %s" , repr ( err ) )
513+ except Exception : # pylint: disable=broad-except
514+ logger .warning ("Failed to log request." )
515515
516516 def on_response (
517517 self ,
518518 request : PipelineRequest [HTTPRequestType ],
519519 response : PipelineResponse [HTTPRequestType , HTTPResponseType ],
520520 ) -> None :
521+ """Logs HTTP response status and headers.
522+
523+ :param request: The PipelineRequest object.
524+ :type request: ~azure.core.pipeline.PipelineRequest
525+ :param response: The PipelineResponse object.
526+ :type response: ~azure.core.pipeline.PipelineResponse
527+ """
521528 http_response = response .http_response
522529
523530 # Get logger in my context first (request has been retried)
@@ -545,8 +552,8 @@ def on_response(
545552 value = self ._redact_header (res_header , value )
546553 log_string += "\n '{}': '{}'" .format (res_header , value )
547554 logger .info (log_string )
548- except Exception as err : # pylint: disable=broad-except
549- logger .warning ("Failed to log response: %s" , repr ( err ) )
555+ except Exception : # pylint: disable=broad-except
556+ logger .warning ("Failed to log response." )
550557
551558
552559class ContentDecodePolicy (SansIOHTTPPolicy [HTTPRequestType , HTTPResponseType ]):
@@ -683,6 +690,11 @@ def deserialize_from_http_generics(
683690 return cls .deserialize_from_text (response .text (encoding ), mime_type , response = response )
684691
685692 def on_request (self , request : PipelineRequest [HTTPRequestType ]) -> None :
693+ """Set the response encoding in the request context.
694+
695+ :param request: The PipelineRequest object.
696+ :type request: ~azure.core.pipeline.PipelineRequest
697+ """
686698 options = request .context .options
687699 response_encoding = options .pop ("response_encoding" , self ._response_encoding )
688700 if response_encoding :
@@ -743,6 +755,11 @@ def __init__(
743755 self .proxies = proxies
744756
745757 def on_request (self , request : PipelineRequest [HTTPRequestType ]) -> None :
758+ """Adds the proxy information to the request context.
759+
760+ :param request: The PipelineRequest object
761+ :type request: ~azure.core.pipeline.PipelineRequest
762+ """
746763 ctxt = request .context .options
747764 if self .proxies and "proxies" not in ctxt :
748765 ctxt ["proxies" ] = self .proxies
0 commit comments