e43cc867f9
Shared AppSheetHeader (title + Done) for the Runs filter/sort and Needs you sheets; Runs filter single-choice groups as check rows and statuses in sentence case; Cupertino decision options as a check list; run action sheet titled with the run; usage page without the duplicate title and with honest empty states; Settings Reconnect wording, compact notifications row and a tinted Cupertino Save workspace; friendly artifact preview failures with Retry.
23 lines
897 B
Dart
23 lines
897 B
Dart
/// The viewer's words for a preview that could not be fetched.
|
|
///
|
|
/// The operator sees what happened in plain language and can retry; the raw
|
|
/// exception text (`TypeError: Failed to fetch`) and bare status lines
|
|
/// (`The server answered 404.`) never reach the screen. [status] is the HTTP
|
|
/// status the server answered, or null when no answer arrived at all.
|
|
String artifactPreviewFailureMessage({int? status}) {
|
|
if (status == null) {
|
|
return 'The preview could not be loaded. Check the connection and try '
|
|
'again.';
|
|
}
|
|
if (status == 404 || status == 410) {
|
|
return 'This file is no longer on the server.';
|
|
}
|
|
if (status == 401 || status == 403) {
|
|
return 'The server did not allow this file to be opened.';
|
|
}
|
|
if (status >= 500) {
|
|
return 'The server could not send this file right now.';
|
|
}
|
|
return 'The preview could not be loaded (status $status).';
|
|
}
|