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
I'm migrating a demo project from rest to graphql and in the spring mvc part, the customized error is using exception handler. The error content can be seperated by status code (500 internal, 400 bad request) to make it a user level error or a server side error.
According to the error handling docs two types of errors is given: Comprehensive Errors and Errors as Data.The Comprehensive Errors part is similar with the SpringMVC's exception handling flow. The Errors as Data part seems try to make a validation instead of exception handling flow which force to have a lot of try-catch to handle this:
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
-
I'm migrating a demo project from rest to graphql and in the spring mvc part, the customized error is using exception handler. The error content can be seperated by status code (500 internal, 400 bad request) to make it a user level error or a server side error.
According to the error handling docs two types of errors is given:
Comprehensive Errors
andErrors as Data
.TheComprehensive Errors
part is similar with the SpringMVC's exception handling flow. TheErrors as Data
part seems try to make a validation instead of exception handling flow which force to have a lot of try-catch to handle this:This looks not that elegant to me. Is there some better way to handle the
Errors as Data
part? The current code is gothinkster/spring-boot-realworld-example-app@472d886 hope this give a more clear description.Beta Was this translation helpful? Give feedback.
All reactions