/// 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).'; }