Skip to content

Commit 2e130be

Browse files
committed
fixed: try getting the message using msg and also getting the message from the exception
1 parent aff0d32 commit 2e130be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Response.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ public function code(): int
9898
*/
9999
public function message(): string
100100
{
101-
return (string) $this->offsetGet('message');
101+
$message = $this->offsetGet('message') ?? $this->offsetGet('msg');
102+
103+
if (!$message && $this->failed()) {
104+
$message = $this->toException()->getMessage();
105+
}
106+
107+
return $message;
102108
}
103109

104110
/**

0 commit comments

Comments
 (0)