Skip to main content
deleted 9 characters in body
Source Link
user53019
user53019

I have a 3-layered app structured as follows.

  • Presentation Layer (ASP.NET MVC project)
  • Business Logic Layer (Services for controllers in PL)
  • Data Access Layer (Repositories)

Each Controller in PL interacts with its service in BLL, which in turn has access to Repositories in DAL.

Is it a good practice to do a "global" try-catch in the PL? That way if exception is thrown in DAL, for example, I can display the error message to the user. Or is there a better way to do this?

Thanks.

I have a 3-layered app structured as follows.

  • Presentation Layer (ASP.NET MVC project)
  • Business Logic Layer (Services for controllers in PL)
  • Data Access Layer (Repositories)

Each Controller in PL interacts with its service in BLL, which in turn has access to Repositories in DAL.

Is it a good practice to do a "global" try-catch in the PL? That way if exception is thrown in DAL, for example, I can display the error message to the user. Or is there a better way to do this?

Thanks.

I have a 3-layered app structured as follows.

  • Presentation Layer (ASP.NET MVC project)
  • Business Logic Layer (Services for controllers in PL)
  • Data Access Layer (Repositories)

Each Controller in PL interacts with its service in BLL, which in turn has access to Repositories in DAL.

Is it a good practice to do a "global" try-catch in the PL? That way if exception is thrown in DAL, for example, I can display the error message to the user. Or is there a better way to do this?

edited title
Link

global try-catch in presentation layer

Source Link

try-catch in presentation layer

I have a 3-layered app structured as follows.

  • Presentation Layer (ASP.NET MVC project)
  • Business Logic Layer (Services for controllers in PL)
  • Data Access Layer (Repositories)

Each Controller in PL interacts with its service in BLL, which in turn has access to Repositories in DAL.

Is it a good practice to do a "global" try-catch in the PL? That way if exception is thrown in DAL, for example, I can display the error message to the user. Or is there a better way to do this?

Thanks.