miso
Copyright(C) 2016-2025 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Exception

Description

 
Synopsis

Types

data MisoException Source #

The MisoException type is used to catch Component-related mounting errors.

The two mounting errors that can occur during the lifetime of a miso application are

  • Not Mounted Exception

This occurs if a user tries to call sample myComponent when myComponent is currently not mounted on the DOM.

  • Already Mounted Exception

It is a requirement that all Component be named uniquely (this is to avoid runaway recursion during mounting). If we detect a Component is attempting to be mounted twice this exception will be raised.

Other exceptions can arise, but its up to the user to handle them in the update function. All unhandled exceptions are caught in the event loop and logged to the console with console.error()

Constructors

NotMountedException MisoString

Thrown when a Component is sampled, yet not mounted.

AlreadyMountedException MisoString

Thrown when a Component is attempted to be mounted twice.

Functions

exception :: SomeException -> JSM JSVal Source #

Exception handler

Used to catch Component mounting exceptions

action `catch` exception