FIxing issues

This commit is contained in:
2025-03-28 22:32:24 +01:00
parent 366962abfa
commit a648a2ea77
5 changed files with 10 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
}
catch (Exception exception)
{
var message = "Something went wrong";
var message = this._somethingWentWrong;
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception.Message}";

View File

@@ -13,6 +13,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
protected readonly IConfiguration _configuration;
protected readonly AppSettings _appSettings;
protected readonly string _requestNotWellFormed = "Request is not well formed";
protected readonly string _somethingWentWrong = "Something went wrong";
protected BaseController(
IConfiguration configuration

View File

@@ -54,7 +54,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
}
catch (Exception exception)
{
var message = "Something went wrong";
var message = this._somethingWentWrong;
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception.Message}";
@@ -105,7 +105,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
}
catch (Exception exception)
{
var message = "Something went wrong";
var message = this._somethingWentWrong;
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception.Message}";
@@ -146,7 +146,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
return NotFound();
}
if(role.IsNotEditable)
if (role.IsNotEditable)
{
return BadRequest("This role is not editable");
}
@@ -170,7 +170,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
}
catch (Exception exception)
{
var message = "Something went wrong";
var message = this._somethingWentWrong;
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception.Message}";
@@ -212,7 +212,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
}
catch (Exception exception)
{
var message = "Something went wrong";
var message = this._somethingWentWrong;
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception.Message}";

View File

@@ -57,7 +57,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
}
catch (Exception exception)
{
var message = "Something went wrong";
var message = this._somethingWentWrong;
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception.Message}";
@@ -118,7 +118,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
}
catch (Exception exception)
{
var message = "Something went wrong";
var message = this._somethingWentWrong;
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception.Message}";