com.dragome.forms.bindings.client.command.ExceptionHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dragome-form-bindings Show documentation
Show all versions of dragome-form-bindings Show documentation
Dragome SDK module: form bindings
package com.dragome.forms.bindings.client.command;
/**
* This class is used by {@link com.pietschy.gwt.pectin.client.command.ExceptionManager} to handle
* various exceptions as they occur.
*/
public abstract class ExceptionHandler
{
private AsyncCommandCallback, E> callback;
public abstract void handle(T error);
@SuppressWarnings("unchecked")
void process(Throwable error, AsyncCommandCallback, E> callback)
{
this.callback= callback;
handle((T) error);
}
public void publishError(E error)
{
getCallback().publishError(error);
}
public void abort()
{
getCallback().abort();
}
public AsyncCommandCallback, E> getCallback()
{
return callback;
}
}