F
error
Shows an error toast with an X icon, titled "Something went wrong" in the user's language, with the error's own message as its text, and logs the error.
function error(cause: unknown): ToastHandleShows an error toast with an X icon, titled "Something went wrong" in the user's language, with the error's own message as its text, and logs the error.
Parameters
| Name | Type | Description |
|---|---|---|
| cause | unknown | What was thrown or rejected: an Error, a string or anything else. |
Returns
ToastHandleA ToastHandle for controlling the shown toast.
function error<K extends keyof Messages>(key: K, ...args: MessageArgs<K, [error: unknown, options?: ToastShorthandOptions]>): ToastHandleShows an error toast titled by a message key, with the error's message as its text, and logs the error.
Parameters
| Name | Type | Description |
|---|---|---|
| key | K | The title's message key. |
| ...args | MessageArgs<K, [error: unknown, options?: ToastShorthandOptions]> | The key's placeholder values when it has placeholders, then the error, then optional |
Returns
ToastHandleA ToastHandle for controlling the shown toast.