Skip to content

Commit

Permalink
Fix allowing a 404 error to be a 'successful' notification download (#…
Browse files Browse the repository at this point in the history
…1298)

This doesn't affect what happens -- saving 404 text to something.mp4 doesn't play -- but it does make the logs easier to see if something is going wrong.
  • Loading branch information
zacwest committed Dec 13, 2020
1 parent 91de019 commit c6cc426
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Shared/API/HAAPI.swift
Expand Up @@ -269,7 +269,7 @@ public class HomeAssistantAPI {
return (downloadPath, [.removePreviousFile, .createIntermediateDirectories])
}

dataManager.download(finalURL, to: destination).responseData { downloadResponse in
dataManager.download(finalURL, to: destination).validate().responseData { downloadResponse in
switch downloadResponse.result {
case .success:
seal.fulfill(downloadResponse.destinationURL!)
Expand Down

0 comments on commit c6cc426

Please sign in to comment.