-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error handling #39
Comments
Good idea. Would this be injected data or 1st class model data? Either way, @ControllerAdvice could do this very easily. |
I don't know actually. Feel free to experiment, lately I cannot get my head around this. I am also thinking that if such an error did really occur a developer today can also inject this to a model. |
You mean that @ControllerAdvice is appriopriate for this because one can register a global @ExceptionHandler there? |
Right, exactly. Since Spring 3.0, the framework is pushing people towards handling exceptions outside of controller methods, either in @exceptionhandlers defined at the controller, or in @ControlelrAdvice, or even in the global exception handlers in the XML context. I'm not sure what Google's original use cases behind injected data were, but I can't help but think page-level models are a strong fit here. Which Atlassian Soy component are you referring to? I don't believe I've seen this before. I'll get to play around with this in some projects I'm working on now, I'll report back after I've had a chance to give it a go. |
What I understood from Google Soy implementation is that Runtime Injected Data ($ij) is mostly used things like global variables, resolved at runtime. It may make some sense to make Exceptions available as GlobalRuntimeData but on another hand it is an exception that rose in this particular controller, so should be local to this controller. This, however, had an disadvantage that we mix normal business data returned to the controller with an exception data. This is an atlassian soy project. Maybe it is worth to look at this more. |
it would be good to handle form errors and put the automatically to model ,e.g Binding Errors, Validation Errors. Similar thing has been achieved in Atlassian Soy component.
The text was updated successfully, but these errors were encountered: