Skip to content

Commit

Permalink
Update ResponseEception to show details first if any
Browse files Browse the repository at this point in the history
  • Loading branch information
nohponex committed Nov 14, 2017
1 parent fb7fdbb commit 155da4b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Exceptions/ResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ public function __construct(Errors $errors)
{
$title = 'Response exception';

if (isset(
$errors->getErrors()[0],
$errors->getErrors()[0]->title
)) {
if (isset($errors->getErrors()[0]->detail)) {
$title = $errors->getErrors()[0]->detail;
} else if (isset($errors->getErrors()[0]->title)) {
$title = $errors->getErrors()[0]->title;
}

Expand Down

0 comments on commit 155da4b

Please sign in to comment.