Throwing multiple exceptions in .Net/C#

前端 未结 5 1427
渐次进展
渐次进展 2020-12-15 15:22

In an application I work on, any business logic error causes an exception to be thrown, and the calling code handles the exception. This pattern is used throughout the appl

5条回答
  •  天涯浪人
    2020-12-15 16:05

    No super-elegant solution here but a few ideas:

    • Pass an error-handler function as argument to DoTasks so the user can decide whether to continue
    • Use tracing to log errors as they occur
    • Concatenate the messages from the other exceptions in the exception bundle's message

提交回复
热议问题