Skip to content

Commit 72f8447

Browse files
author
Clément Le Provost
committed
Make error types initializers public
We use them in AlgoliaSearchHelper.
1 parent 5a6cb4d commit 72f8447

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Source/Error.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ import Foundation
3030
public struct InvalidJSONError: CustomNSError {
3131
/// Further description of this error.
3232
public let description: String
33-
33+
34+
public init(description: String) {
35+
self.description = description
36+
}
37+
3438
// MARK: CustomNSError protocol
3539
// ... for Objective-C bridging.
3640

@@ -54,7 +58,7 @@ public struct HTTPError: CustomNSError {
5458
/// Optional message returned by the server.
5559
public let message: String?
5660

57-
internal init(statusCode: Int, message: String? = nil) {
61+
public init(statusCode: Int, message: String? = nil) {
5862
self.statusCode = statusCode
5963
self.message = message
6064
}

0 commit comments

Comments
 (0)