question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow setting the default responseHandler at a higher level

See original GitHub issue

Because of #2354 (which is addressed in #2363, pending feedback), we have resorted to adding a custom responseHandler to each and every endpoint definition.

This gets tedious, and it’s easy for one of the several developers on our team to miss a case until we run into a run-time PARSING_ERROR when we get a "text/plain" response.

It would be very convenient to be able to set the default responseHandler across all endpoints in the options to createApi.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
phryneascommented, Oct 26, 2022

I added a PR for that today - #2823

But it’s part of fetchBaseQuery. createApi doesn’t have any concept of response handlers.

0reactions
markeriksoncommented, Oct 30, 2022

Merged into the 1.9 branch

Read more comments on GitHub >

github_iconTop Results From Across the Web

The responseHandler should respect Content-Type headers
I believe the default responseHandler should be a little more ... Allow setting the default responseHandler at a higher level #2385.
Read more >
fetchBaseQuery - Redux Toolkit
Handling non-standard Response status codes​. By default, fetchBaseQuery will reject any Response that does not have a status code of 2xx and ...
Read more >
Pass value to Apache Httpclient Response Handler
Hi I am using apache http client and i was wondering of it is possible top have a generic response hande.
Read more >
DecompressingHttpClient (Apache HttpClient 4.5.13 API)
Executes HTTP request using the default context and processes the response using the given response handler. Implementing classes are required to ensure that ......
Read more >
Error Handling for REST with Spring - Baeldung
Solution 1: the Controller-Level @ExceptionHandler ... It will also allow us to implement a uniform exception handling mechanism in our REST ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found