-
Notifications
You must be signed in to change notification settings - Fork 32
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
Better exception message from ApiException #39
Comments
Thanks for reporting this. We're investigating ways to improve it. |
Ultimately all "Default*Api" classes call https://github.com/square/square-java-sdk/blob/65a992f0355ee404655170e00022cda2c71df01a/src/main/java/com/squareup/square/api/BaseApi.java |
any progress on this one? I keep running into unexplainable "HTTP Response Not OK" errors and I am just guessing as to what I need to fix. One of my http responses worked too... not sure why! |
@finci-square aha I found my issue and I think that'll find yours, make sure you are importing the right ApiException class! I was getting mine from a google package instead of squares, then following this documentation for error handling: https://developer.squareup.com/docs/sdks/java/using-java-sdk#handle-the-responses |
Square should consider renaming the class name
…On Sat, Nov 11, 2023 at 1:30 PM Bryce Blankinship ***@***.***> wrote:
@finci-square <https://github.com/finci-square> aha I found my issue and
I think that'll find yours, make sure you are importing the right
ApiException class! I was getting mine from a google package instead of
squares, then following this documentation for error handling:
https://developer.squareup.com/docs/sdks/java/using-java-sdk#handle-the-responses
—
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANQHD2UECDKSB4FULA5P7FTYD674HAVCNFSM4WSECU22U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBQGY4DQNJZGU4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@BryceBlankinship @sseaman @finci-square I'm importing right class but still getting same error message. Any alternative solution can you suggest? |
Which API are you calling that is returning this error? @finci-square @BryceBlankinship I have notified our team that creates the SDKs about stripping away the error message. I will update when I have more information about the change. I have also asked that they consider changing the name of the class to prevent potential name conflicts. |
Awesome thanks |
Thanks for the response @zenmasterjobo, I'm using this API "paymentsApi.createPayment(body)"; and getting error message "HTTP Response Not OK". |
Hi @AnkitPatel1404 - if you can log into your developer dashboard and then click into your app, and then click |
@zenmasterjobo @finci-square, In square dashboard, I got response like this "errors": [
|
Non successful http responses yield an ApiException whose message is just "HTTP Response Not OK". This is very cryptic and quite frustrating if the developer hasn't written code to capture more information about the error. It would be much improved if we parse the error response body and give an exception message that includes details from the response.
The text was updated successfully, but these errors were encountered: