-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Error Body not parsing properly for cherry pick #499
Comments
Hmm, not sure, ill give it a look :) |
Thank you for your response, please let me know whether it is an issue from my side or repository side |
Guys any update regarding this? |
Would if you could debug further. By looking at way it is trying to parse. |
Ya I am getting the response as an HTML body in Postman, it is showing that
But as per the API docs, it should throw the same error message in JS as well |
So the error is being eaten up somewhere. hmm |
Could be a few things, I'm guessing the response content-type is json but the actual content is an html page. This would explain the < error, and is similar to what is explained here https://stackoverflow.com/questions/56178321/invalid-json-response-body-error-with-express-node-fetch-using-formdata could you check the content-type you are getting from the postman request? |
Ya the content type is HTML in Postman |
@sdc224 So in the headers, it says the content-type is one of the below:
? I have a strong feeling it still says "application/json" |
Ya @jdalrymple , the headers showing this in response(In Postman)
One more thing, for all type of errors, it is showing the same in node-gitlab error
|
Hmm, not really sure then, since the default content-type handler is:
Ill try and recreate it this weekend and see if i can trace the correct source of the error. I'm guessing its within the processBody function. |
Sure man, thanks for looking into it |
Guys got any solution? |
Not yet, still writing up a good test to recreate this |
I was able to recreate your test case, but it seems to error out properly, not with the one you outlined above (json parsing error). Could you provide some more information about your setup? The library version you are using? Or even a test repository with the error recreated. |
Sir need to first clear one thing that I am using git in VPN, which means I am using this library for calling git API of our organisation created in gitlab. So maybe that might creating some issue |
I am using 12.0.0 version of gitlab. For any kind of error message, it is showing the same as above(Unexpected < ) |
@sdc224 Were you able to test with your local gitlab account? I cant do much about your VPN setup lol. Might have to do with your security settings. Have you checked if its has to do with certificates? maybe try the 12.1.1 beta and setting rejectUnauthorized:false |
@jdalrymple Sorry for late reply man |
Sorry but I am not getting your steps, can you please elaborate a little? |
In Postman, we are getting some HTML pages as response instead of a JSON showing {message: ""} |
One more thing, can anyone tell me the difference between MergeRequests.accept and MergeRequests.approve? |
@sdc224 If youre getting that response in postman, then the library wont be useful to you. The html page usually comes up when there is a security issue. What is the HTML page that is being returned? Is it the login page? As for your second question: |
@jdalrymple Thanks you so much for your answer for the second question. For the response thing, we are getting an HTML page saying 404 not found. I just want to know is there any provision to pass the HTML and return some good error message in JS? |
If we can recreate the error, then yea ill add a way to work around the html thing. As for now, I haven't been able to recreate the html response and while i have seen Not Found Errors, those are handled correctly. |
Sure guys, thank you all for your efforts to help me out in this matter. I will try to solve my problem, if I got any update, then I will inform you all. By the way, please help me if you come to know anything regarding parsing HTML as JSON. One more question guys, while uisng the Cherry Pick, it is not creating any MR just like we can cherry pick a Merge Request in Gitlab UI. Is there any other API to do that(I know how to do it step by step...creating a new branch, cherry pick into that and MR...I want to know a one step process) |
@sdc224 I dont think that functionally currently exists in the API :'( |
Hi guys, In webpage console I get the exact error code everytime while doing this, only the response contains HTML, that's why I get Unexpected end of JSON
at @gitbreaker/browser/dist/index.js : 16 Is there any way to intercept that error or return it from the library, to help in this kind of scenario? |
Working on that right now #764 :) |
Hi,
I am using this node dependency to create a VSCode extension. My extension supports Cherry Picking a commit just like Gitlab way(I mean start a new Merge Request while cherry picking). But when I am trying to use the cherryPick function like
I am getting this error
Note:
Already I have tried MergeRequests, Commits, they are working fine.
The text was updated successfully, but these errors were encountered: