jasontaylordev / NorthwindTraders

Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Place for custom application exceptions

neman opened this issue · comments

In application layer, there is folder Common\Exception.

Where would I put Application Exception which is specific and not shared? And it's not Domain Exception either.

For example, I want to have InvalidEmailTokenException, which is thrown from one command handler and one query handler (which are located in User folder).
It would look something like this:

  • Users
    • Commands
    • Queries
    • Exceptions

Common sense suggests me that I should have Exception folder, on the same level of Commands and Queries folders.
image

As these exceptions are domain entities related, you can put under the Domain Class Project. There is also an exception folder in Domain where you can put Domain related exceptions.

Thank you for your interest in this project. This repository has been archived and is no longer actively maintained or supported. We appreciate your understanding. Feel free to explore the codebase and adapt it to your own needs if it serves as a useful reference. If you have any further questions or concerns, please refer to the README for more information.