Skip to main content

FileErrorState

FileErrorState

The right message and action for a FilesError - retry (honouring Retry-After), back to the root, or neither

Tags: files error empty-state retry

Renders a FilesError (or any error) with describeFilesError(): a title, a plain-language description and the right action. Retryable errors get "Try again", held back while the server's Retry-After runs ("Try again in 8s"). Bad or missing paths get "Back to …". Staff never see status codes or server messages. See the table on FileBrowser.

Import​

<script>
  import { FileErrorState } from '@classic-homes/files-svelte';
</script>

Basic Usage​

<FileErrorState {error} onretry={reload} onroot={() => (path = '')} rootLabel="Land Development" />

Props​

Prop Type Default Description
error unknown required The error, usually a FilesError
onretry () => void - Offer "Try again" for retryable errors
onroot () => void - Offer "Back to …" for bad or missing paths
rootLabel string - Label of the root, for the back button
size 'sm' | 'md' 'md' Size of the empty state
class string - Classes for the outer element
On this page