Error treatments 404 and 500

Asked

Viewed 162 times

0

Good afternoon, my question is as I am still beginner in Asp.net and on the DDD still I have a certain doubt which is in which layer using the DDD standard I would implement the 404 and 500 error treatment, whether it would be in the Presentation layer or in the below or any other layer and why it would be implemented in that layer.

1 answer

0

Create within Presentation/Views/Error/

Create two files
Erro404.cshtml
Erro500.cshtml

Add to your web.config the following line

<customErrors mode="On" defaultRedirect="~/Error.html" redirectMode="ResponseRewrite">
  <error statusCode="404" redirect="~/Error/Erro404" />
  <error statusCode="500" redirect="~/Error/Erro500" />
</customErrors>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.