Skip to content

FileErrorCode

Copy as Markdown

FileErrorCode = "unsupported" | "network" | "size" | "integrity" | "gzip" | "json" | "format" | "version" | "internal"

What a failed load or mount tells (error.code), and what to do:

  • unsupported: the browser or the page lacks what the player needs (DecompressionStream, DOMParser, FontFace, constructable stylesheets), the root is in another document than the player’s (an iframe’s), an integrity was given outside a secure context (it needs crypto.subtle: serve the page over https), or the page’s Trusted Types refused the rupa-player policy (allow it in trusted-types).
  • network: the file could not be fetched, or the server answered with an error status (in the message): check the URL, and that another origin allows the request (CORS).
  • size: the download is over 25 MB, the file unpacks to over 50 MB, or its CSS holds over 20000 rules and selectors: export a smaller file.
  • integrity: the integrity option is malformed (it must be sha256-<base64>), does not match the file’s bytes, or was given with a file already parsed (RupaFile), whose bytes are gone.
  • gzip: the bytes are not gzip, or are cut short: the file is damaged or is not a .rupaplay file.
  • json: the bytes unpack to text that is not JSON.
  • format: the JSON is not a .rupaplay file (the message names the field that fails), or its markup has no root element of its root class.
  • version: the file is of a newer format, or needs a newer player (its player field): update the player.
  • internal: an unexpected error inside the player (in error.cause); mountFile left the root as it was.