Strata · API

StrataError

StrataError is the error class the package throws: a code to branch on, a sentence, and details, a list of specifics. Its message is the sentence followed by each detail on its own line. Here upgrade is called with a misspelt kind, so it throws UNKNOWN_KIND and details lists the declared kinds.

Call
upgrader.upgrade({ text: 'Book seats' }, { kind: 'theatre.buttons/buton' })
Error properties
{
  name: 'StrataError',
  code: 'UNKNOWN_KIND',
  details: ['theatre.buttons/button'],
}
Error message
No sequence declares the document kind "theatre.buttons/buton".
  theatre.buttons/button
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.