Skip to content

Commit

Permalink
Improve error message (PLAYRTS-5527) (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyby authored May 19, 2024
1 parent 00d36b4 commit ee59886
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
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

0 comments on commit ee59886

Please sign in to comment.