-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
ErrorListener does not support message array #56
Comments
I submitted those changes to the gitlab codebase. This is my fault, sorry :) I'll try to submit a patch here. |
If you would be able to create a patch that would be great. But looking back through the commit history I'm not sure that this issue was ever not present, and certainly can't find something that you would have changed that causes this. Note: I just started using thing lib, so I'm not sure it it was supposed to work before. Nor do I know if this a previous GitLab API responded differently. |
@jubianchi was saying that he'd made a change to the actual gitlab codebase, and the corresponding code in this repo has never been updated. I think anyway... |
That makes sense :). Thanks for looking into this, but just let me know if I'll need to make a patch + pull request. |
Any news about that issue ? Still got some
Shouldn't we just cast the throw new RuntimeException((string) $errorMessage, $response->getStatusCode()); |
I think simply casting it to a string will just throw a Array to string conversion notice. Not really a solution imo. |
Hello folks! I'm working on a patch right now, sorry for the delay I was really busy. |
Lots of ways of handling this...
@jubianchi @Maff- @j0k3r thoughts? |
👍 So this error :
should generate this exception message:
I prefer to see all informations at once instead of getting the first error, fixin it, retryin, getting the second error (which I've not seen the first time since only the first error is reported), etc .. |
@j0k3r Yeh I agree. @jubianchi have you done anything on this yet? If not I'll do it now.. lemme know. |
I'm inpatient 😉 |
@m4tthumphrey thanks ! Could you tag a new release then? |
@m4tthumphrey I was about to do the same thing you did in your patch: parse the JSON containing error messages and format them as a comma separated list of errors. 👍 thanks for the patch :) |
@j0k3r I'm working on a few clean up updates, once thats done I'll tag a new release. |
@m4tthumphrey It seems to not be fully fixed, I just got :
I guess I'm running Gitlab 7.8.2. |
@j0k3r Do you what the Gitlab error was that caused it? |
Sadly not. |
What were you trying to do when you had it? |
It's hard to say because we have integrated your Gitlab API inside an internal project that rely on Git to store some config file. This error was reported to us by a user that use this project, so hard to say. I could be a commit, a push or a merge request creation. I can give you first lines of the stacktrace:
|
Looks like merge request creation...
I'll take a look. |
Should be sorted; there was an obvious bug with the 3rd param of the sprintf but that doesn't account for the field being |
Sounds good to me 👍 |
The
Gitlab\HttpClient\Listener\ErrorListener
will produce a Fatal error (Wrong parameters for ErrorException) when the Gitlab API returns a error message that contains an array instead of a string message. Offending line: 46This will mostly happen when an data validation error occurs. See Data validation and error reporting for possible response formats.
A simple solution could be to json encode the message when it's not a string.
Used versions: GitLab 7.4.0; GitLab API v3
The text was updated successfully, but these errors were encountered: