Skip to content
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

onError didn't give me http response #25

Closed
lovepanda603 opened this issue Jul 25, 2024 · 3 comments
Closed

onError didn't give me http response #25

lovepanda603 opened this issue Jul 25, 2024 · 3 comments

Comments

@lovepanda603
Copy link

server: user springboot,if There is an error in the business in the program,my program will return a 500 http status,and a json body:"{'code':1001,'msg':'no permit'}"

onError: (oops) {
// Oops! Time to handle those little hiccups.
// You can also choose to disconnect here
print("---onError----");
print(oops.message);
}
print:
Connection Error Status:500, Connection Error Reason:
can't get 这body "{'code':1001,'msg':'no permit'}"

@Imgkl
Copy link
Owner

Imgkl commented Jul 25, 2024

@lovepanda603 Thanks for filing the issue, Are you saying when there is a error, the status code and the json body is not getting printed by doing this?

onError: (oops) {
// Oops! Time to handle those little hiccups.
// You can also choose to disconnect here
print("---onError----");
print(oops.message);
}

@lovepanda603
Copy link
Author

lovepanda603 commented Jul 26, 2024

@lovepanda603 Thanks for filing the issue, Are you saying when there is a error, the status code and the json body is not getting printed by doing this?

onError: (oops) {
// Oops! Time to handle those little hiccups.
// You can also choose to disconnect here
print("---onError----");
print(oops.message);
}

my print is : I/flutter ( 5145): Connection Error Status:500, Connection Error Reason:

I can't get nothing,but Program business requirements json body

I'm use sse in java(okhttp-sse),angular(@microsoft/fetch-event-source),all support this

@Imgkl
Copy link
Owner

Imgkl commented Aug 26, 2024

Hey @lovepanda603,

This is fixed on the latest version, 2.1.2. Please update the package to get this data.

Now the EventFluxException has message prop for you to get this.

@Imgkl Imgkl closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants