-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Exception handling for 422 / existing items #170
Comments
We’d welcome a pr to make this more clearer |
Is this the official API package of the commercial forge business? |
@cord this is the official package, yes. |
Great, would be nice if you can improve the customer experience with the API package by returning a meaningful exception in case of already existing items. |
@cord, you can do the following: use Laravel\Forge\Exceptions\ValidationException;
try {
$forge→createDatabase('123', [
'name' => 'test'
'user' => 'dojziam11j',
'password' => 'hQUHWg3ovi'
]);
} catch (ValidationException $e) {
dump($e->errors());
} |
@jbrooksuk thanks, that returns some information. However I would expect different types of exception based on situation. Probably requires some work on forge as well. |
@cord what kind of exceptions are you expecting? The error is a validation error, so a |
@jbrooksuk it seems When trying to create a server with a taken name a So I wish there would be different exceptions for each situation we need to handle. |
requests like
can trigger a misleading Exception
Testing in postman reveals the true reason:
I would expect to receive a meaningful exception with more information about the cause.
The text was updated successfully, but these errors were encountered: