Add error messages
This commit is contained in:
parent
69573991ca
commit
e7b737a3dd
2 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ public class AdminOnlyHandler : AuthorizationHandler<AdminOnlyRequirement>
|
|||
}
|
||||
catch (NotFoundException _)
|
||||
{
|
||||
throw new ForbiddenException();
|
||||
throw new ForbiddenException("You need to be logged in to do this action.");
|
||||
}
|
||||
|
||||
if (_userProfileService.IsUserProfileAdmin(userProfile))
|
||||
|
|
|
@ -15,8 +15,8 @@ public class ProductTableService(ApplicationDbContext context)
|
|||
{
|
||||
var productTable =
|
||||
await _context.ProductTable.FirstOrDefaultAsync(x => x.ProductTableName == productTableName) ??
|
||||
throw new NotFoundException();
|
||||
|
||||
throw new NotFoundException($"Product table with the name {productTableName} not found.");
|
||||
|
||||
return new ProductTableGet
|
||||
{
|
||||
ProductTableName = productTable.ProductTableName,
|
||||
|
|
Loading…
Reference in a new issue