You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request: Enhanced Error Handling with Custom JSON Responses
Overview
Firstly, I want to express my admiration for the exceptional toast package and the dedication put into its development.
Proposal
I would like to suggest an enhancement to the toast.promise functionality. Currently, the error message is constructed based on the HTTP status or a predefined custom message. However, i believe it would be beneficial to extend this capability to handle custom errors from the JSON body. This idea comes from this being how I return data from my API:
Improved customization: Users can tailor error messages based on the specifics of the JSON response.
Enhanced error reporting: Deeper insights into the nature of errors for better debugging.
Conclusion
I believe this enhancement would improve the toast package, offering users a more versatile and comprehensive error-handling experience.
Thank you for considering this feature request!
The text was updated successfully, but these errors were encountered:
jamesindeed
changed the title
Feature Request | Use JSON body error message in toast.promise
[Feature Request]: Use JSON body error message in toast.promise
Dec 28, 2023
Feature Request: Enhanced Error Handling with Custom JSON Responses
Overview
Firstly, I want to express my admiration for the exceptional toast package and the dedication put into its development.
Proposal
I would like to suggest an enhancement to the
toast.promise
functionality. Currently, the error message is constructed based on the HTTP status or a predefined custom message. However, i believe it would be beneficial to extend this capability to handle custom errors from the JSON body. This idea comes from this being how I return data from my API:Current implementation in the package
View in Code
Benefits
Conclusion
I believe this enhancement would improve the toast package, offering users a more versatile and comprehensive error-handling experience.
Thank you for considering this feature request!
The text was updated successfully, but these errors were encountered: