Skip to content

Commit e4404e9

Browse files
committed
Add ATProtoError
Tis is the best exception protocol that all custom errors will conform to.
1 parent 1280e18 commit e4404e9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Sources/ATProtoKit/Errors/ATProtoError.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
import Foundation
99

10+
public protocol ATProtoError: Error {}
11+
1012
/// The base exception class for ATProtoKit.
11-
public enum ATProtoError: Error, Decodable {
13+
public enum ATAPIError: ATProtoError, Decodable {
1214
/// Represents a bad request error (HTTP 400) with an associated message.
1315
/// - Parameter message: The message received along side the error.
1416
case badRequest(message: String) // Error 400
@@ -105,3 +107,9 @@ public enum ATProtoError: Error, Decodable {
105107
case message
106108
}
107109
}
110+
111+
/// An error type related to ``ATImageProcessable``..
112+
enum ATImageProcessingError: ATProtoError {
113+
/// The image's file size can't be lowered any further to fit the target file size.
114+
case unableToResizeImage
115+
}

0 commit comments

Comments
 (0)