Files
BeWoPlaner/Shared/Core/AppError.cs

35 lines
1.1 KiB
C#
Raw Normal View History

using BS.Shared.DataContracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.Core
{
public class AppError
{
public string Code { get; set; }
public string Message { get; set; }
public string Displayname => $"AppError {Code}: {Message}";
2025-05-26 11:36:48 +02:00
// Private damit zentral alle Errors
private AppError(string code, string message)
{
Code = code;
Message = message;
}
2025-05-26 11:36:48 +02:00
//public static readonly AppError Example = new AppError("Code", "Message");
2025-07-03 13:55:46 +02:00
public static readonly AppError ApiResponseFailed = new AppError("API.100001", "Api Fehler");
public static readonly AppError JsonParsingError = new AppError("API.100002", "Json Parsing Fehler");
public static readonly Func<Type, AppError> UnsupportedType = (type) => new AppError("BEW.100001", $"Type nicht implementiert: {type}");
public static readonly Func<OrganisationDC, AppError> GkvDatenannahmestelleAdresseNotFound = (dc) => new AppError("GKV.70001", $"Unbekannte Datenannahmestelle. Bitte neu in der Organisation {dc.Name} ermitteln");
}
}