Add server error message details (fix #221)

This commit is contained in:
Arkadiusz Fal 2022-08-05 10:39:37 +02:00
parent cbae8628c9
commit a0088e5404

View File

@ -234,7 +234,16 @@ extension PlayerModel {
} }
private func videoLoadFailureHandler(_ error: RequestError) { private func videoLoadFailureHandler(_ error: RequestError) {
navigation.presentAlert(title: "Could not load video", message: error.userMessage) var message = error.userMessage
if let errorDictionary = error.json.dictionaryObject,
let errorMessage = errorDictionary["message"] ?? errorDictionary["error"],
let errorString = errorMessage as? String
{
message += "\n"
message += errorString
}
navigation.presentAlert(title: "Could not load video", message: message)
advancing = false advancing = false
videoBeingOpened = nil videoBeingOpened = nil
currentItem = nil currentItem = nil