Skip to content

Commit ce011c3

Browse files
author
Evgeniy Guseletov
committed
Merge pull request #76 from AD7six/feature/better-missing-error
provide a better missing error message
2 parents 28c010c + 05a3319 commit ce011c3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/Github/HttpClient/Listener/ErrorListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function postSend(RequestInterface $request, MessageInterface $response)
5757
foreach ($content['errors'] as $error) {
5858
switch ($error['code']) {
5959
case 'missing':
60-
$errors[] = sprintf('Resource "%s" not exists anymore', $error['resource']);
60+
$errors[] = sprintf('The %s %s does not exist, for resource "%s"', $error['field'], $error['value'], $error['resource']);
6161
break;
6262

6363
case 'missing_field':

test/Github/Tests/HttpClient/Listener/ErrorListenerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public function shouldNotPassWhen422IsSentWithErrorCode($errorCode)
124124
array(
125125
'code' => $errorCode,
126126
'field' => 'test',
127+
'value' => 'wrong',
127128
'resource' => 'fake'
128129
)
129130
)

0 commit comments

Comments
 (0)