Core.API ist für die Paketierung konfiguriert.
This commit is contained in:
@@ -33,15 +33,13 @@ namespace DigitalData.Core.API
|
||||
/// <param name="message">Optional. A custom error message to include in the response.</param>
|
||||
/// /// <param name="messageKey">Optional. A custom error message key to include in the response.</param>
|
||||
/// <returns>An ObjectResult representing an internal server error (status code 500).</returns>
|
||||
public static ObjectResult InnerServiceError(this ControllerBase controllerBase, Exception? ex = null, string? message = null, Enum? messageKey = null)
|
||||
public static ObjectResult InnerServiceError(this ControllerBase controllerBase, Exception? ex = null, string? message = null)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
if (ex is not null)
|
||||
sb.AppendLine(ex.Message);
|
||||
if (message is not null)
|
||||
sb.AppendLine(message);
|
||||
if (messageKey is not null)
|
||||
sb.AppendLine(messageKey.ToString());
|
||||
|
||||
return controllerBase.StatusCode(500, sb.Length > 0 ? sb.ToString() : null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user