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
Hi guys, I was wondering what would be the best approach for using the centralized error handling approach when working with a server that both serves HTML and JSON over HTTP.
My stack is Go+Templ+Echo. The custom error handler works fine on the JSON part as I can do stuff like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi guys, I was wondering what would be the best approach for using the centralized error handling approach when working with a server that both serves HTML and JSON over HTTP.
My stack is Go+Templ+Echo. The custom error handler works fine on the JSON part as I can do stuff like:
I just catch all the errors after the handlers, either there are no errors and I do nothing, or there is an error, I store it and send a response.
When using Templ, i do:
I don't really care about the error from the render function.
For now if there is a business error, since the render function rarely throws any error, I never log anything.
How should i manage this?
Beta Was this translation helpful? Give feedback.
All reactions