scriptella.core
Class OnErrorHandler

java.lang.Object
  extended by scriptella.core.OnErrorHandler

public class OnErrorHandler
extends java.lang.Object

Error handler for scripting elements.

This class maintains an internal copy of onerrorElements for ScriptEl to allow calling onError(Throwable) several times with different return result.

Version:
1.0
Author:
Fyodor Kupolov

Constructor Summary
OnErrorHandler(ScriptEl scriptEl)
          Initialize error handler with the list of OnErrorEl.
 
Method Summary
protected  java.util.Set<java.lang.String> getErrorCodes(java.lang.Throwable t)
           
 OnErrorEl onError(java.lang.Throwable throwable)
          Called on error to get a OnErrorEl with fallback script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnErrorHandler

public OnErrorHandler(ScriptEl scriptEl)
Initialize error handler with the list of OnErrorEl.

Parameters:
scriptEl - scripting element configuration to get onerror info.
Method Detail

onError

public OnErrorEl onError(java.lang.Throwable throwable)
Called on error to get a OnErrorEl with fallback script.

Note: The returned OnErrorEl element is removed from internal list of elements to avoid handling the same error condition twice.

Parameters:
throwable -
Returns:
OnErrorEl matching error condition.

getErrorCodes

protected java.util.Set<java.lang.String> getErrorCodes(java.lang.Throwable t)
Parameters:
t - throwables chain.
Returns:
not null set of found error codes in throwable chain.


Copyright © Copyright 2006-2009 The Scriptella Project Team.