Skip to content

Commit 22c1d08

Browse files
committed
Merge pull request #17 from m4tthumphrey/master
Add fall back message for custom error messages
2 parents 3242cf5 + da77143 commit 22c1d08

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Github/HttpClient/Listener/ErrorListener.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,14 @@ public function postSend(RequestInterface $request, MessageInterface $response)
7171
$errors[] = sprintf('Field "%s" already exists, for resource "%s"', $error['field'], $error['resource']);
7272
break;
7373

74+
default:
75+
$errors[] = $error['message'];
76+
break;
77+
7478
}
7579
}
7680

77-
throw new ValidationFailedException('Validation Failed:' . implode(', ', $errors), 422);
81+
throw new ValidationFailedException('Validation Failed: ' . implode(', ', $errors), 422);
7882
}
7983
}
8084

0 commit comments

Comments
 (0)