This repository has been archived on 2023-02-13. You can view files and clone it, but cannot push or open issues or pull requests.
gswi-server/gswi.Model/Filter/ServiceException.cs

23 lines
661 B
C#
Raw Normal View History

2022-02-20 19:04:11 +01:00
using System;
namespace gswi.Model.Filters
{
public class ServiceException: Exception {
public ServiceErrorCode ErrorCode { get; set; }
public string ErrorMessage { get; set; }
public string Nameof { get; set; }
public ServiceException(ServiceErrorCode errorCode, string errorMessage) {
ErrorCode = errorCode;
ErrorMessage = errorMessage;
}
public string GetMessage() {
return ErrorMessage;
}
public string GetDetailedMessage() {
return $"{nameof(ServiceException)} - ErrorCode: {ErrorCode} - ErrorMessage: {ErrorMessage}";
}
}
}