2025-05-23 11:02:31 +02:00
using BS.Shared.DataContracts ;
using BS.Shared.Interface ;
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 ; }
2025-05-27 09:24:37 +02:00
public Dictionary < string , string > Arguments { get ; set ; }
public List < AppError > InnerErrors { get ; set ; }
2025-05-23 11:02:31 +02:00
public string Displayname = > $"AppError {Code}: {Message}" ;
2025-05-26 11:36:48 +02:00
// Private damit zentral alle Errors
2025-05-27 09:24:37 +02:00
private AppError ( string code , string message , Dictionary < string , string > arguments = null , List < AppError > innerErrors = null )
2025-05-23 11:02:31 +02:00
{
Code = code ;
Message = message ;
2025-05-27 09:24:37 +02:00
Arguments = arguments ;
InnerErrors = innerErrors ;
2025-05-23 11:02:31 +02:00
}
2025-06-02 11:16:35 +02:00
public AppError ( )
{
}
2025-05-26 11:36:48 +02:00
//public static readonly AppError Example = new AppError("Code", "Message");
2025-05-23 11:02:31 +02:00
public static readonly Func < OrganisationDC , AppError > GkvDatenannahmestelleAdresseNotFound = ( dc ) = > new AppError ( "GKV.70001" , $"Unbekannte Datenannahmestelle. Bitte neu in der Organisation {dc.Name} ermitteln" ) ;
}
}