File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1298,7 +1298,14 @@ public function parseResponse($responseDecoded, $responseCode)
12981298
12991299 // no break
13001300 case 401 :
1301- $ msg = (\array_key_exists ('message ' , $ responseDecoded ) ? $ responseDecoded ['message ' ] : $ responseDecoded [key ($ responseDecoded )]['message ' ]).' for ' .$ this ->getApiURL ();
1301+ if (\array_key_exists ('message ' , $ responseDecoded )) {
1302+ $ msg = $ responseDecoded ['message ' ];
1303+ } elseif (isset ($ responseDecoded [key ($ responseDecoded )]['message ' ])) {
1304+ $ msg = $ responseDecoded [key ($ responseDecoded )]['message ' ];
1305+ } else {
1306+ $ msg = sprintf ("Unexpected response data [%s]: %s " , $ responseCode , json_encode ($ responseDecoded ));
1307+ }
1308+ $ msg .= ' for ' .$ this ->getApiURL ();
13021309 $ this ->addStatusMessage ($ msg , 'error ' );
13031310
13041311 if ($ this ->throwException ) {
You can’t perform that action at this time.
0 commit comments