I have a layered architecture application. All the error handling is done at business layer and data layer throws the error to business layer. Presentation layer shows this custom error to user. Along with that I have a common error page where the HTTP related errors are going. I don’t have any try catch block in presentation layer.
But I need to know the best practice to handle the presentation layer error. Assume like the user expect to enter some decimal numbers, but some characters appended along with that. So how can I handle such kind of error? Should I write code to handle that without writing try catch or should have try catch in my presentation layer code?
Another scenario is I am reading one file from a location, but if the file is not present there, then I should catch this in try catch block or presentation or I should write code for all possible errors?
Thanks