Error handling in clean architecture

1,159 views
Skip to first unread message

Norbert Nemes

unread,
Mar 18, 2015, 10:22:29 AM3/18/15
to clean-code...@googlegroups.com
Hello everyone.

I'm curious if and how any of you implement error handling in clean architecture.
If an error happens in the Entities/interactors, do you cascade it back to the view?
Or do you have a "global" error manager?

Regards,

Norbert.

vivek poddar

unread,
Mar 18, 2015, 1:56:56 PM3/18/15
to clean-code...@googlegroups.com
+1

--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.

Łukasz Duda

unread,
Mar 18, 2015, 3:12:02 PM3/18/15
to clean-code...@googlegroups.com
Hi Norbert,
I usually implement global error handling outside application (at MVC controller level). The simple solution is to log all errors and return response without error details (for security reasons). The client recognises response and shows common error message. If the error is expected in some situation, the application can handle it or show appropriate message through responder instead throwing exception.
If you're interested, I could publish an example?

Greetings from hard-working Warsaw

Norbert Nemes

unread,
Mar 18, 2015, 7:19:50 PM3/18/15
to clean-code...@googlegroups.com
Yes, please.
I have a global manager in mind to which the (entities and) interactors would push errors and the manager would call back to the currently active presenter and ask if it handles the type of error it received, and if it does, it sends it the error. But I would like to see how others do this, maybe I get a better idea,

Łukasz Duda

unread,
Mar 21, 2015, 5:14:10 PM3/21/15
to clean-code...@googlegroups.com
I've published some examples of my approach to handling errors in .NET.
https://github.com/lukasz-duda/ErrorHandling
https://github.com/lukasz-duda/ErrorHandling/commit/bdb54f8e427213d8f7bed0c797afc525fb7304d9 - comments
Let me know if you have some questions or comments.

Elias Fofanov

unread,
Apr 29, 2015, 10:30:55 AM4/29/15
to clean-code...@googlegroups.com
The topic of errors handling via exceptions is an interesting and extremely important one.
Are there any approaches to designing the politics of exception types creating and handling them?
For example, should we create our own types of exceptions by layers, say, IDbException, IDomainException, e.t.c.? Or, maybe, we should design it somehow else?

Tomer Ben David

unread,
May 6, 2015, 11:33:53 PM5/6/15
to clean-code...@googlegroups.com
Have a look at this post: https://tersesystems.com/2012/12/27/error-handling-in-scala/  it kind of bring some order into when to use exceptions, when return values etc.
Reply all
Reply to author
Forward
0 new messages