LingForCC / MyTodoList

5 stars 1 forks source link

Implement the ErrorCodeGenerator #25

Closed LingForCC closed 5 years ago

LingForCC commented 5 years ago

The basic idea is to have the concept of ErrorCodeGenerator and ErrorCodeGeneratorManager. ErrorCodeGenerator generates the error code for a specific type of ServiceException. ErrorCodeGeneratorManager is the container for all ErrorCodeGenerator. In this way, whenever an exception is thrown out of Service, ErrorCodeGeneratorManager can take the exception and create corresponding error code in Controller layer.

You can start from ErrorCodeGenerator.cs and ErrorCodeGeneratorManager.cs.

Resolve: #14