Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b6c3cc6

Browse files
Update Errors.swift
1 parent fc70e15 commit b6c3cc6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎Sources/replicate-kit-swift/error/Errors.swift‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
//
22
// Errors.swift
3-
//
3+
//
44
//
55
// Created by Igor on 08.03.2023.
66
//
77

88
import Foundation
99

10-
extension ReplicateAPI{
10+
extension ReplicateAPI{
1111

1212
/// Set of replicate API errors
1313
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
1414
public enum Errors: Error, Hashable, LocalizedError {
15-
15+
1616
/// Base URL error
1717
case baseURLError
1818

@@ -31,6 +31,9 @@ extension ReplicateAPI{
3131
/// Could not decode error format response
3232
case couldNotDecodeErrorContainer
3333

34+
/// Client-specific error with a custom message
35+
case clientError(String)
36+
3437
/// Provides a localized description for each error case.
3538
public var errorDescription: String? {
3639
switch self {
@@ -51,6 +54,9 @@ extension ReplicateAPI{
5154

5255
case .couldNotDecodeErrorContainer:
5356
return NSLocalizedString("Could not decode the error response. The format might be incorrect.", comment: "Decoding error")
57+
58+
case .clientError(let message):
59+
return message
5460
}
5561
}
5662
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /