@@ -9,7 +9,7 @@ import Foundation
9
9
10
10
/// An enumeration that represents various errors that can occur in the VRCKit framework.
11
11
/// Conforms to the `Error` and `LocalizedError` protocols for better error handling and localization.
12
- public enum VRCKitError : Error , LocalizedError {
12
+ public enum VRCKitError : Error , LocalizedError , Equatable {
13
13
private typealias RawValue = String
14
14
15
15
/// Represents an error from the API with details.
@@ -19,32 +19,30 @@ public enum VRCKitError: Error, LocalizedError {
19
19
case clientDeallocated
20
20
21
21
/// Represents an error indicating an invalid response was received.
22
- case invalidResponseError
22
+ case invalidResponse
23
23
24
24
/// Represents an error indicating an invalid request with additional details.
25
25
case invalidRequest( _ details: String )
26
26
27
+ /// Represents an error indicating an authentication failure.
28
+ case unauthorized
29
+
27
30
/// Represents an unexpected error.
28
- case unexpectedError
31
+ case unexpected
29
32
30
33
/// Represents an url error.
31
34
case urlError
32
35
33
36
/// Provides a localized description of the error.
34
37
public var errorDescription : String ? {
35
38
switch self {
36
- case . apiError:
37
- " API Error "
38
- case . clientDeallocated:
39
- " Client Deallocated "
40
- case . invalidResponseError:
41
- " Invalid Response Error "
42
- case . invalidRequest:
43
- " Invalid Request "
44
- case . unexpectedError:
45
- " Unexpected Error "
46
- case . urlError:
47
- " URL Error "
39
+ case . apiError: " API Error "
40
+ case . clientDeallocated: " Client Deallocated "
41
+ case . invalidResponse: " Invalid Response "
42
+ case . invalidRequest: " Invalid Request "
43
+ case . unauthorized: " Unauthorized "
44
+ case . unexpected: " Unexpected "
45
+ case . urlError: " URL Error "
48
46
}
49
47
}
50
48
0 commit comments