Skip to content

Commit

Permalink
feat(hand edit): make discoveryv2 environment init throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-arn committed Jan 17, 2020
1 parent 6e8e72b commit 1510586
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Source/DiscoveryV2/Discovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ public class Discovery {
- parameter version: The release date of the version of the API to use. Specify the date
in "YYYY-MM-DD" format.
*/
public init?(version: String) {
public init(version: String) throws {
self.version = version
guard let authenticator = ConfigBasedAuthenticatorFactory.getAuthenticator(credentialPrefix: serviceSdkName) else {
return nil
}

let authenticator = try ConfigBasedAuthenticatorFactory.getAuthenticator(credentialPrefix: serviceSdkName)
self.authenticator = authenticator

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

0 comments on commit 1510586

Please sign in to comment.