Core.API ist für die Paketierung konfiguriert.

This commit is contained in:
Developer 02
2024-06-20 16:58:39 +02:00
parent 0ad92e7592
commit b6adf7ed8b
4 changed files with 20 additions and 15 deletions

View File

@@ -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);
}