Skip to content

Commit

Permalink
Merge pull request #73 from jamf/release-1.2.1-finishing-touches
Browse files Browse the repository at this point in the history
Release 1.2.1 finishing touches
  • Loading branch information
hisaac authored Sep 16, 2020
2 parents caf5651 + 11cb145 commit 5a097b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/JamfProClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ struct JamfProClient {
sendRequest(endpoint: "osxconfigurationprofiles", data: xml.xmlData) { (statusCode, resultData) in
let success: Bool = (200 <= statusCode && statusCode <= 299)
if !success {
var errMessage = ""
if let text = String(data: resultData, encoding: .utf8) {
print("Error (\(statusCode)):\n\(text)")
errMessage = "Error (\(statusCode)):\n\(text)"
} else {
print("Unknown error: \(statusCode)")
errMessage = "Unknown error: \(statusCode)"
}
print(errMessage)
Alert().display(header: "Upload failed", message: errMessage)
}
completionBlock(success)
}
Expand Down

0 comments on commit 5a097b2

Please sign in to comment.