From 96194dcce7d3ee992ca5c3887bc798f783608ffd Mon Sep 17 00:00:00 2001 From: dtsiflit Date: Fri, 1 Nov 2024 10:51:35 +0200 Subject: [PATCH] [fix] updated credential error --- Sources/Entities/Errors/CredentialError.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Sources/Entities/Errors/CredentialError.swift b/Sources/Entities/Errors/CredentialError.swift index 468d822..ec4a86c 100644 --- a/Sources/Entities/Errors/CredentialError.swift +++ b/Sources/Entities/Errors/CredentialError.swift @@ -15,9 +15,22 @@ */ import Foundation -public enum CredentialError: Error { +public enum CredentialError: LocalizedError { case genericError case issuerDoesNotSupportDeferredIssuance case extraneousQueryComponents case invalidScheme + + public var errorDescription: String? { + switch self { + case .genericError: + return "Something went wrong" + case .issuerDoesNotSupportDeferredIssuance: + return "Issuer does not support deferred issuance" + case .extraneousQueryComponents: + return "Extraneous query components" + case .invalidScheme: + return "Invalid scheme" + } + } }