Customization on error response
See original GitHub issueHow to properly handle response? I created an ~error.vue
and it works for other error responses like 404 response but not on 429.
Version
nuxt-security: ^0.9.0 nuxt: 3.0.0
Reproduction Link
What is Expected?
I was expecting to customize the error response like redirecting to another page or customize the default response.
What is actually happening?
I am getting the default error response from nuxt
Thank you
Issue Analytics
- State:
- Created 9 months ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
How To Implement Custom Error Responses in Express - Auth0
Learn why you may need custom error responses on 4xx errors, what a good custom format looks like, and how to apply it...
Read more >Error response customization (beta) - Akamai TechDocs
You can customize responses related to the following errors: API key invalid. The API key in the incoming request does not exist in...
Read more >Custom Error Message Handling for REST API - Baeldung
Custom Error Message Handling for REST API · 1. Overview · 2. A Custom Error Message · 3. Handle Bad Request Exceptions ·...
Read more >Amazon API Gateway Enables Customization of Error ... - AWS
Now, you can customize the responses returned by your API Gateway APIs so that they provide useful information to your client applications.
Read more >Custom error responses (beta) · Cloudflare Rules docs
Custom error responses, powered by the Ruleset Engine, allow you to define custom responses for errors returned by an origin server or by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ReaganM02
You are in the right place 😉
Are you using the correct branch? It should be
feat/optional-throw-error
I cannot pass the method as it is removed from the config in the middleware. Instead, I will add an optional property called
throwError
. By default it has a value of true and will throw an error once certain condition is met (for example 429 after too many requests from rate limiter). But when set to false, it will return an object with the error but will not throw an error. Thanks to this approach you will be able to take this object and do whatever you want with it. For example show a custom error. I will create a pull request with this functionality for you to check out.