Skip to content

Commit

Permalink
catching empty hosts now
Browse files Browse the repository at this point in the history
  • Loading branch information
czechboy0 committed Oct 3, 2015
1 parent ac2a810 commit 991e9db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion XcodeServerSDK.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "XcodeServerSDK"
s.version = "0.3.5"
s.version = "0.3.6"
s.summary = "Access Xcode Server API with native Swift objects."

s.homepage = "https://github.com/czechboy0/XcodeServerSDK"
Expand Down
5 changes: 5 additions & 0 deletions XcodeServerSDK/XcodeServerConfig.swift
Expand Up @@ -67,11 +67,16 @@ public struct XcodeServerConfig : JSONSerializable {
- returns: A fully initialized `XcodeServerConfig` instance.
- throws:
- `NoHostProvided`: When the host string is empty.
- `InvalidHostProvided`: When the host provided doesn't produce a valid `URL`
- `InvalidSchemeProvided`: When the provided scheme is not `HTTPS`
*/
public init(var host: String, user: String? = nil, password: String? = nil, id: RefType? = nil) throws {

guard !host.isEmpty else {
throw ConfigurationErrors.NoHostProvided
}

guard let url = NSURL(string: host) else {
throw ConfigurationErrors.InvalidHostProvided(host)
}
Expand Down

0 comments on commit 991e9db

Please sign in to comment.