* Rename FrameworkException to NotFoundException in order to
reflect actual usage/semantics.
This commit is contained in:
parent
116a111d5a
commit
230469d544
2 changed files with 52 additions and 9 deletions
43
src/helma/framework/NotFoundException.java
Normal file
43
src/helma/framework/NotFoundException.java
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* Helma License Notice
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Helma License
|
||||||
|
* Version 2.0 (the "License"). You may not use this file except in
|
||||||
|
* compliance with the License. A copy of the License is available at
|
||||||
|
* http://adele.helma.org/download/helma/license.txt
|
||||||
|
*
|
||||||
|
* Copyright 1998-2003 Helma Software. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* $RCSfile$
|
||||||
|
* $Author$
|
||||||
|
* $Revision$
|
||||||
|
* $Date$
|
||||||
|
*/
|
||||||
|
|
||||||
|
package helma.framework;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The basic exception class used to tell when certain things go
|
||||||
|
* wrong in evaluation of requests.
|
||||||
|
*/
|
||||||
|
public class NotFoundException extends RuntimeException {
|
||||||
|
/**
|
||||||
|
* Creates a new NotFoundException object.
|
||||||
|
*
|
||||||
|
* @param message ...
|
||||||
|
*/
|
||||||
|
public NotFoundException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new NotFoundException object with a cause.
|
||||||
|
*
|
||||||
|
* @param message the message
|
||||||
|
* @param cause the cause
|
||||||
|
*/
|
||||||
|
public NotFoundException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
|
@ -239,7 +239,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
action = getAction(currentElement, null, req);
|
action = getAction(currentElement, null, req);
|
||||||
|
|
||||||
if (action == null) {
|
if (action == null) {
|
||||||
throw new FrameworkException("Action not found");
|
throw new NotFoundException("Action not found");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// march down request path...
|
// march down request path...
|
||||||
|
@ -262,7 +262,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
|
|
||||||
for (int i = 0; i < ntokens; i++) {
|
for (int i = 0; i < ntokens; i++) {
|
||||||
if (currentElement == null) {
|
if (currentElement == null) {
|
||||||
throw new FrameworkException("Object not found.");
|
throw new NotFoundException("Object not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathItems[i].length() == 0) {
|
if (pathItems[i].length() == 0) {
|
||||||
|
@ -288,7 +288,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentElement == null) {
|
if (currentElement == null) {
|
||||||
throw new FrameworkException("Object not found.");
|
throw new NotFoundException("Object not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == null) {
|
if (action == null) {
|
||||||
|
@ -296,10 +296,10 @@ public final class RequestEvaluator implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == null) {
|
if (action == null) {
|
||||||
throw new FrameworkException("Action not found");
|
throw new NotFoundException("Action not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (FrameworkException notfound) {
|
} catch (NotFoundException notfound) {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
|
|
||||||
// we already have an error and the error template wasn't found,
|
// we already have an error and the error template wasn't found,
|
||||||
|
@ -318,7 +318,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
action = getAction(currentElement, notFoundAction, req);
|
action = getAction(currentElement, notFoundAction, req);
|
||||||
|
|
||||||
if (action == null) {
|
if (action == null) {
|
||||||
throw new FrameworkException(notfound.getMessage());
|
throw new NotFoundException(notfound.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentElement == null) {
|
if (currentElement == null) {
|
||||||
throw new FrameworkException("Method name \"" +
|
throw new NotFoundException("Method name \"" +
|
||||||
function + "\" could not be resolved.");
|
function + "\" could not be resolved.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
// reset skin recursion detection counter
|
// reset skin recursion detection counter
|
||||||
skinDepth = 0;
|
skinDepth = 0;
|
||||||
if (!scriptingEngine.hasFunction(currentElement, functionName, false)) {
|
if (!scriptingEngine.hasFunction(currentElement, functionName, false)) {
|
||||||
throw new FrameworkException(missingFunctionMessage(currentElement, functionName));
|
throw new NotFoundException(missingFunctionMessage(currentElement, functionName));
|
||||||
}
|
}
|
||||||
result = scriptingEngine.invoke(currentElement,
|
result = scriptingEngine.invoke(currentElement,
|
||||||
functionName, args,
|
functionName, args,
|
||||||
|
@ -580,7 +580,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
// check if we tried to process the error already,
|
// check if we tried to process the error already,
|
||||||
// or if this is an XML-RPC request
|
// or if this is an XML-RPC request
|
||||||
if (error == null) {
|
if (error == null) {
|
||||||
if (!(x instanceof FrameworkException)) {
|
if (!(x instanceof NotFoundException)) {
|
||||||
app.errorCount += 1;
|
app.errorCount += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue