Skip to content

Commit

Permalink
Merge pull request #12 from Bolid1/master
Browse files Browse the repository at this point in the history
Hint добавлена в текст ошибки
  • Loading branch information
bessudnov authored Oct 6, 2020
2 parents bd08727 + 9536271 commit 86003b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/AmoCRMException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ public static function errorResponse(ResponseInterface $response, $data)
$message .= ': ' . $data['detail'];
}

if (!empty($data['hint'])) {
$message .= " ({$data['hint']})";
}

$code = $response->getStatusCode();
$body = (string)$response->getBody();
return new static($message, $code, $body);
}
}
}

0 comments on commit 86003b2

Please sign in to comment.