campi e metodi di error_type
Un campo è un dato semplice sul valore, letto con un punto e senza parentesi: $value.name. Un metodo richiede argomenti o esegue un'operazione, e si chiama con ->: $value->name(arguments), oppure passando il valore con la pipe: $value |> name(arguments).
Campi
| Campo | Tipo | Descrizione |
|---|---|---|
.description | string | A cosa serve il tipo di errore, oppure null. |
.extends | string | Il tipo di errore che estende, oppure null. |
.fields | list | I campi dell'errore (i suoi e quelli che eredita): name, type, optional e description. |
.name | string | Il nome del tipo di errore. |
.status | number | Lo stato HTTP associato agli errori di questo tipo, come 404, oppure null. |
Metodi da any
->convert(from?: 'json'|yaml|'csv'|'markdown'|'latex', to?: 'json'|yaml|'csv'|html|'markdown'|'latex', header?: bool, as?: type, headers?: list, indented?: bool)->from(type: 'json'|yaml|'csv'|'markdown'|'latex', header?: bool, as?: type)->is_a(type: word)->is_null()->or(fallback)->to(type: 'json'|yaml|'csv'|html|'markdown'|'latex', headers?: list, indented?: bool)->to_string()->type()