1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 06:10:32 +05:30

Add server error message details (fix #221)

This commit is contained in:
Arkadiusz Fal 2022-08-05 10:39:37 +02:00
parent 384a884195
commit e50a14b13a

View File

@ -234,7 +234,16 @@ extension PlayerModel {
}
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
videoBeingOpened = nil
currentItem = nil