Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message (PLAYRTS-5527) #481

Merged
merged 2 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@
Error message when a media cannot be opened via Handoff, deep linking or a push notification */
"The media cannot be opened." = "Il media non può essere riprodotto.";

/* Error message when a page cannot be opened via Handoff, deep linking or a push notification
/* Error message when a page cannot be opened from a page section title
Error message when a page cannot be opened via Handoff, deep linking or a push notification
Error message when a topic cannot be opened via Handoff, deep linking or a push notification */
"The page cannot be opened." = "La pagina non può essere aperta.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@
Error message when a media cannot be opened via Handoff, deep linking or a push notification */
"The media cannot be opened." = "Il medium na po betg vegnir avert.";

/* Error message when a page cannot be opened via Handoff, deep linking or a push notification
/* Error message when a page cannot be opened from a page section title
Error message when a page cannot be opened via Handoff, deep linking or a push notification
Error message when a topic cannot be opened via Handoff, deep linking or a push notification */
"The page cannot be opened." = "La preschentaziun na po betg vegnir averta.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@
Error message when a media cannot be opened via Handoff, deep linking or a push notification */
"The media cannot be opened." = "Le contenu ne peut être ouvert.";

/* Error message when a page cannot be opened via Handoff, deep linking or a push notification
/* Error message when a page cannot be opened from a page section title
Error message when a page cannot be opened via Handoff, deep linking or a push notification
Error message when a topic cannot be opened via Handoff, deep linking or a push notification */
"The page cannot be opened." = "La page ne peut être ouverte.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@
Error message when a media cannot be opened via Handoff, deep linking or a push notification */
"The media cannot be opened." = "Der Inhalt kann nicht geöffnet werden.";

/* Error message when a page cannot be opened via Handoff, deep linking or a push notification
/* Error message when a page cannot be opened from a page section title
Error message when a page cannot be opened via Handoff, deep linking or a push notification
Error message when a topic cannot be opened via Handoff, deep linking or a push notification */
"The page cannot be opened." = "Seite konnte nicht geöffnet werden.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@
Error message when a media cannot be opened via Handoff, deep linking or a push notification */
"The media cannot be opened." = "The media cannot be opened.";

/* Error message when a page cannot be opened via Handoff, deep linking or a push notification
/* Error message when a page cannot be opened from a page section title
Error message when a page cannot be opened via Handoff, deep linking or a push notification
Error message when a topic cannot be opened via Handoff, deep linking or a push notification */
"The page cannot be opened." = "The page cannot be opened.";

Expand Down
12 changes: 9 additions & 3 deletions Application/Sources/Content/PageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,15 @@ extension PageViewController: SectionHeaderViewAction {

SRGDataProvider.current!.contentPage(for: ApplicationConfiguration.shared.vendor, uid: id)
.receive(on: DispatchQueue.main)
.sink { error in
if case .failure(let failure) = error {
Banner.showError(failure as NSError)
.sink { result in
if case .failure = result {
let error = NSError(
domain: PlayErrorDomain,
code: PlayErrorCode.notFound.rawValue,
userInfo: [
NSLocalizedDescriptionKey: NSLocalizedString("The page cannot be opened.", comment: "Error message when a page cannot be opened from a page section title")
])
Banner.showError(error)
}
} receiveValue: { contentPage in
let pageViewController = PageViewController.pageViewController(for: contentPage)
Expand Down
3 changes: 2 additions & 1 deletion Translations/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@
Error message when a media cannot be opened via Handoff, deep linking or a push notification */
"The media cannot be opened." = "The media cannot be opened.";

/* Error message when a page cannot be opened via Handoff, deep linking or a push notification
/* Error message when a page cannot be opened from a page section title
Error message when a page cannot be opened via Handoff, deep linking or a push notification
Error message when a topic cannot be opened via Handoff, deep linking or a push notification */
"The page cannot be opened." = "The page cannot be opened.";

Expand Down