Error: Replace the cancel error user-side

If a Task is cancelled, this was deliberate and prevent a huge error
from showing up on the user side.

Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
kingbri 2022-08-10 21:40:55 -04:00
parent 33c9a4ead2
commit 42ff275935
2 changed files with 7 additions and 2 deletions

View file

@ -45,10 +45,14 @@ public class DebridManager: ObservableObject {
}
} catch {
Task { @MainActor in
toastModel?.toastDescription = "RealDebrid hash error: \(error)"
let error = error as NSError
if error.code != -999 {
toastModel?.toastDescription = "RealDebrid hash error: \(error)"
}
}
print(error)
print("RealDebrid hash error: \(error)")
}
}

View file

@ -149,6 +149,7 @@ class ScrapingViewModel: ObservableObject {
default:
toastModel?.toastDescription = "Error in fetching data \(error)"
}
print("Error in fetching data \(error)")
return nil