Several posts cover the issue of providing user-friendly messages based on catched exceptions, like Report exception message
I am also of the opinion to wrap exceptions of a lower layer to a defined exception of the current layer to ensure encapsulation. For example a service or domain layer should not expose exceptions from data access layer.
In my UI layer I catch the exceptions defined in service or domain layer and transform them to meaningful user messages in dialogs. I do not use the exception message because it might 1) not be user-friendly and 2) not be internationalized.
Now I am developing a mobile app the first time. I find it useful and Importamt for the users to show them an appropriate message if an action cannot be executed because of connection or network issues (maybe bad or no service or in flight mode etc.)
To show this kind of message I must catch it from the service/domain layer to transform to a user-friendly message and do internationalization etc. But this seams counterintuitive to me to expose these kind of exceptions in this layer.
So is it okay to have NetworkException exposed in domain layer in a mobile app? Or are there any other techniques to handle this scenario? I feel a bit bad about this because it introduces a leaky abstraction, but I have no idea how else to get information on these low level exceptions that are important for users.
Or am I on the wrong path and it is quite okay to tell the user "Operation x cannot be executed", without giving any reason?
Update:
Eric Evans shows this diagram in his DDD book:
There is a connection from UI layer to infrastructure layer. Can this be interpreted as the UI may be aware directly of Infrastructure exceptions?