0
LiSong created
-
ABP Framework version: v0.X.X
-
UI Type: MVC
-
Database System: SQL Server
-
Tiered (for MVC) or Auth Server Separated (for Angular): no
-
Exception message and full stack trace:
-
Steps to reproduce the issue:
I have created a CRUD page, and I added a logic to check for the delete button:
[Authorize(TappPermissions.TappOrganizations.Delete)]
public override async Task DeleteAsync(Guid id)
{
var users = await _tappOrganizationUsersAppService.GetListAsync(new GetTappOrganizationUsersInput()
{
TappOrganization = id,
MaxResultCount = 1
});
if (users.Items.Any())
throw new Exception("This organization can't be deleted because it has users associated with it.");
await _tappOrganizationRepository.DeleteAsync(id);
}
and I am trying to show the exception message on this pop up window. how can I do that?
thanks
1 Answer(s)
-
0
Can you try
UserFriendlyException
instead ofException
?[Authorize(TappPermissions.TappOrganizations.Delete)] public override async Task DeleteAsync(Guid id) { var users = await _tappOrganizationUsersAppService.GetListAsync(new GetTappOrganizationUsersInput() { TappOrganization = id, MaxResultCount = 1 }); if (users.Items.Any()) throw new UserFriendlyException("This organization can't be deleted because it has users associated with it."); await _tappOrganizationRepository.DeleteAsync(id); }