Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.client.api.base
Class DefaultErrorCallback

java.lang.Object
  extended by org.jboss.errai.bus.client.api.base.DefaultErrorCallback
All Implemented Interfaces:
ErrorCallback<Message>

public class DefaultErrorCallback
extends Object
implements ErrorCallback<Message>

The default error callback implementation, used when MessageBuildParms.defaultErrorHandling() was invoked (which is the default when there is no explicit mention of error handling to the MessageBuilder).

Author:
Mike Brock, Christian Sadilek

Field Summary
static String CLIENT_ERROR_SUBJECT
           
static DefaultErrorCallback INSTANCE
           
 
Constructor Summary
DefaultErrorCallback()
           
 
Method Summary
 boolean error(Message message, Throwable e)
          Constructs an error message and puts it on the client message bus with the subject CLIENT_ERROR_SUBJECT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DefaultErrorCallback INSTANCE

CLIENT_ERROR_SUBJECT

public static final String CLIENT_ERROR_SUBJECT
See Also:
Constant Field Values
Constructor Detail

DefaultErrorCallback

public DefaultErrorCallback()
Method Detail

error

public boolean error(Message message,
                     Throwable e)
Constructs an error message and puts it on the client message bus with the subject CLIENT_ERROR_SUBJECT. The error message is constructed with the following parts:
Subject
CLIENT_ERROR_SUBJECT
ErrorMessage
e.getMessage() if e != null; otherwise, "Null exception reference"
AdditionalDetails
HTML marked-up stack trace of e if e != null; otherwise, "No additional details"
Throwable
A marshalled representation of the exception object e if e != null; otherwise, this message part is omitted.

Specified by:
error in interface ErrorCallback<Message>
Parameters:
message - The message or request for which the failure occurred.
e - The exception thrown or null if not available
Returns:
boolean indicating whether or not the default error handling should be performed.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.