sorted.add(handler);
}
public void invoke(PipelineContext pipelineContext) throws Exception {
TurbineRunDataInternal rundata = (TurbineRunDataInternal) getTurbineRunData(request);
ErrorHandlerHelper helper = ErrorHandlerHelper.getInstance(request);
Throwable exception = helper.getException();
// ģ���п��õ�helper
rundata.getContext().put(helperName, helper);
if (exception != null) {
int statusCode = -1;
String target = null;
// ���������exception cause��ʼ�����ݣ����磺t1 caused by t2 caused by t3��
// ��ô�����˳��Ϊt3, t2, t1��
CAUSES: for (Throwable cause : getCauses(exception, true)) {
// ����ÿ���쳣������ƥ���exception handlers��
// ����handlers�Ѿ�����������쳣��ǰ������T1 extends T2����ôT1��T2֮ǰ��
for (ExceptionHandler exceptionHandler : exceptionHandlers) {
if (exceptionHandler.getExceptionType().isInstance(cause)) {
statusCode = exceptionHandler.getStatusCode();
target = exceptionHandler.getPage();
break CAUSES;
}
}
}
if (statusCode > 0) {
rundata.getResponse().setStatus(statusCode);
helper.setStatusCode(statusCode); // ����request attributes
}
if (target == null) {
target = defaultPage;
}