File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -222,20 +222,21 @@ async def process_request(
222222 except ValueError :
223223 _LOGGER .warning ("Non JSON response: %s" , message )
224224
225+ error = await resp .text ()
226+
225227 if resp .status == 400 :
226228 _LOGGER .error ("Error 400: %s" , message ["msg" ])
227229 raise ParseJSONError
228230 if resp .status == 401 :
229- error = await resp .text ()
230231 _LOGGER .error ("Authentication error: %s" , error )
231232 raise AuthenticationError
232233 if resp .status == 404 :
233- _LOGGER .error ("%s" , message [ "msg" ] )
234+ _LOGGER .error ("%s" , error )
234235 raise UnknownError
235236 if resp .status == 405 :
236- _LOGGER .error ("%s" , message [ "msg" ] )
237+ _LOGGER .error ("%s" , error )
237238 elif resp .status == 500 :
238- _LOGGER .error ("%s" , message [ "msg" ] )
239+ _LOGGER .error ("%s" , error )
239240
240241 return message
241242
You can’t perform that action at this time.
0 commit comments