Closed puschie286 closed 2 years ago
You need to use try catch
block in your app service to catch your Business Exception then throw UserFriendly Exception with the cought data as you like.
Why? Because business rules (referring to domain rules and their exceptions) are independent from application service and UI. Your Code 101 Business Exception may have unnecessary information for mobile UI but you may want to show detailed info for Web UI. So you need to catch the exception and throw different UserFriendly exceptions in different app services for the same business exception.
well there are some conditions to show it without userfriendlyexception
BuisnessExceptions are automaticly shown if your ErrorCode starts with your resource/project name. https://github.com/abpframework/abp/blob/12677fb2307d1b48451bf991f8a86092847de9cd/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs#L135-L141
and the question of this Issue is to put this information into the documentation - everything works, but documentation miss this information
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
original issue was closed due non related anwser please read the description! https://github.com/abpframework/abp/issues/10050