Skip to content

Commit 52788bc

Browse files
committed
feat(hand edit): make VR V4 environment init throwable
this should be provided by the generator in future releases BREAKING CHANGE: turns the init? into an init -> throws
1 parent 9cbd222 commit 52788bc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Source/VisualRecognitionV4/VisualRecognition.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ public class VisualRecognition {
5757
- parameter version: The release date of the version of the API to use. Specify the date
5858
in "YYYY-MM-DD" format.
5959
*/
60-
public init?(version: String) {
60+
public init(version: String) throws {
6161
self.version = version
62-
guard let authenticator = ConfigBasedAuthenticatorFactory.getAuthenticator(credentialPrefix: serviceSdkName) else {
63-
return nil
64-
}
62+
63+
let authenticator = try ConfigBasedAuthenticatorFactory.getAuthenticator(credentialPrefix: serviceSdkName)
6564
self.authenticator = authenticator
6665

6766
if let serviceURL = CredentialUtils.getServiceURL(credentialPrefix: serviceSdkName) {

0 commit comments

Comments
 (0)