My scenarios is delete a record in application service, the method defined in Application Service is 'DeleteItem', before do a delete action to entity, I need to return some messages to UI, such as,
1 It cannot be deleted, because something 2 It be deleted, the deleted identifier is xxx, the item name is xxx.
I knew there is a "UserFriendlyException" could throw exception to UI, but it will caused the network with 500 internal server error status.
Is there ABP provided a common message dto to transfer message?
5 Answer(s)
-
0
Hi,
Sorry for the late response, I have missed your post somehow. Currently there is no class like that to provide what you are looking for.
-
0
This is a most common useful message transfer, I think ABP framework should provide one that like UserFriendlyException class done but without inherit from System.Exception
-
0
Hi,
You can create an issue regarding to this request on github here <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues">https://github.com/aspnetboilerplate/as ... ate/issues</a>. We will consider it.
-
0
I also have the exact same issue. I would like to use a more granular general return value than userfriendlyException. You might look at AjaxResponse object in ABP framework. I think that is what you mean. But I don't know what would be the side effect of using it in xAppService classes. Because ABP and Zero, do many things automatically.
-
0
<cite>Alex: </cite> I also have the exact same issue. I would like to use a more granular general return value than userfriendlyException. You might look at AjaxResponse object in ABP framework. I think that is what you mean. But I don't know what would be the side effect of using it in xAppService classes. Because ABP and Zero, do many things automatically.
Yes, I had considered try to use AjaxResponse, but it is complex to extend it, it will impact ABP original more.