OnError

annotation class OnError

Annotate a method inside your component with @OnError to receive a callback when an exception inside supported delegate methods of a child component happens. You then get a chance to either trigger a state update or reraise the exception using ComponentUtils.raise .

The method will receive a ComponentContext, and an Exception.

An example use may look like this:

@OnError
 static Component onError(
     ComponentContext c,
     Exception e,
    @Prop SomeProp prop) {
   MyComponent.updateErrorAsync(c, String.format("Error for %s: %s", prop, e.getMessage()));
 }

Functions

Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun toString(): String