From 406d3e16e7dd08e28a32bd5ea7b3d3f6e59744fd Mon Sep 17 00:00:00 2001 From: Meysam Hadeli Date: Thu, 3 Jul 2025 23:39:55 +0330 Subject: [PATCH] chore: cleanup unused files --- building-blocks/Exception/AppException.cs | 14 ------- .../Exception/BadRequestException.cs | 13 ------- .../Exception/ConflictException.cs | 11 ------ building-blocks/Exception/CustomException.cs | 37 ------------------- building-blocks/Exception/DomainException.cs | 16 -------- .../Exception/InternalServerException.cs | 17 --------- .../Exception/NotFoundException.cs | 11 ------ .../Exception/ValidationException.cs | 11 ------ 8 files changed, 130 deletions(-) delete mode 100644 building-blocks/Exception/AppException.cs delete mode 100644 building-blocks/Exception/BadRequestException.cs delete mode 100644 building-blocks/Exception/ConflictException.cs delete mode 100644 building-blocks/Exception/CustomException.cs delete mode 100644 building-blocks/Exception/DomainException.cs delete mode 100644 building-blocks/Exception/InternalServerException.cs delete mode 100644 building-blocks/Exception/NotFoundException.cs delete mode 100644 building-blocks/Exception/ValidationException.cs diff --git a/building-blocks/Exception/AppException.cs b/building-blocks/Exception/AppException.cs deleted file mode 100644 index f567498..0000000 --- a/building-blocks/Exception/AppException.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Net; - -namespace BuildingBlocks.Exception; - -public class AppException : CustomException -{ - public AppException(string message, HttpStatusCode statusCode = HttpStatusCode.BadRequest, int? code = null) : base(message, statusCode, code: code) - { - } - - public AppException(string message, System.Exception innerException, HttpStatusCode statusCode = HttpStatusCode.BadRequest, int? code = null) : base(message, innerException, statusCode, code) - { - } -} diff --git a/building-blocks/Exception/BadRequestException.cs b/building-blocks/Exception/BadRequestException.cs deleted file mode 100644 index 6056488..0000000 --- a/building-blocks/Exception/BadRequestException.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Net; - -namespace BuildingBlocks.Exception -{ - public class BadRequestException : CustomException - { - public BadRequestException(string message, int? code = null) : base(message, HttpStatusCode.BadRequest, code: code) - { - - } - } -} diff --git a/building-blocks/Exception/ConflictException.cs b/building-blocks/Exception/ConflictException.cs deleted file mode 100644 index 4d45372..0000000 --- a/building-blocks/Exception/ConflictException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Net; - -namespace BuildingBlocks.Exception -{ - public class ConflictException : CustomException - { - public ConflictException(string message, int? code = null) : base(message, HttpStatusCode.Conflict, code: code) - { - } - } -} diff --git a/building-blocks/Exception/CustomException.cs b/building-blocks/Exception/CustomException.cs deleted file mode 100644 index 586dcd8..0000000 --- a/building-blocks/Exception/CustomException.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Net; - -namespace BuildingBlocks.Exception; - -public class CustomException : System.Exception -{ - public CustomException( - string message, - HttpStatusCode statusCode = HttpStatusCode.InternalServerError, - int? code = null) : base(message) - { - StatusCode = statusCode; - Code = code; - } - - public CustomException( - string message, - System.Exception innerException, - HttpStatusCode statusCode = HttpStatusCode.InternalServerError, - int? code = null) : base(message, innerException) - { - StatusCode = statusCode; - Code = code; - } - - public CustomException( - HttpStatusCode statusCode = HttpStatusCode.InternalServerError, - int? code = null) : base() - { - StatusCode = statusCode; - Code = code; - } - - public HttpStatusCode StatusCode { get; } - - public int? Code { get; } -} diff --git a/building-blocks/Exception/DomainException.cs b/building-blocks/Exception/DomainException.cs deleted file mode 100644 index b8f661f..0000000 --- a/building-blocks/Exception/DomainException.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Net; -using BuildingBlocks.Exception; - -namespace SmartCharging.Infrastructure.Exceptions -{ - public class DomainException : CustomException - { - public DomainException(string message, HttpStatusCode statusCode = HttpStatusCode.BadRequest) : base(message, statusCode) - { - } - - public DomainException(string message, Exception innerException, HttpStatusCode statusCode = HttpStatusCode.BadRequest, int? code = null) : base(message, innerException, statusCode, code) - { - } - } -} diff --git a/building-blocks/Exception/InternalServerException.cs b/building-blocks/Exception/InternalServerException.cs deleted file mode 100644 index e276cc2..0000000 --- a/building-blocks/Exception/InternalServerException.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Globalization; -using System.Net; - -namespace BuildingBlocks.Exception -{ - public class InternalServerException : CustomException - { - public InternalServerException() : base() { } - - public InternalServerException(string message, int? code) : base(message, code: code) { } - - public InternalServerException(string message, int? code = null, params object[] args) - : base(message: String.Format(CultureInfo.CurrentCulture, message, args, HttpStatusCode.InternalServerError, code)) - { - } - } -} diff --git a/building-blocks/Exception/NotFoundException.cs b/building-blocks/Exception/NotFoundException.cs deleted file mode 100644 index 4367ca0..0000000 --- a/building-blocks/Exception/NotFoundException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Net; - -namespace BuildingBlocks.Exception -{ - public class NotFoundException : CustomException - { - public NotFoundException(string message, int? code = null) : base(message, HttpStatusCode.NotFound, code: code) - { - } - } -} diff --git a/building-blocks/Exception/ValidationException.cs b/building-blocks/Exception/ValidationException.cs deleted file mode 100644 index f3c812b..0000000 --- a/building-blocks/Exception/ValidationException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Net; - -namespace BuildingBlocks.Exception -{ - public class ValidationException : CustomException - { - public ValidationException(string message, int? code = null) : base(message, HttpStatusCode.BadRequest, code: code) - { - } - } -}