mirror of
https://github.com/DanilaFe/abacus
synced 2026-09-25 21:02:38 +00:00
Add a separate class of exceptions for NumberReducer.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package org.nwapw.abacus.exception;
|
||||
|
||||
/**
|
||||
* Exception thrown by the NumberReducer if something goes wrong when
|
||||
* transforming a parse tree into a single value.
|
||||
*/
|
||||
public class NumberReducerException extends AbacusException {
|
||||
|
||||
/**
|
||||
* Creates a new NumberReducerException with
|
||||
* no additional message.
|
||||
*/
|
||||
public NumberReducerException() {
|
||||
this("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new NumberReducerException with the given message.
|
||||
* @param message the message.
|
||||
*/
|
||||
public NumberReducerException(String message) {
|
||||
super("Error evaluating expression", message);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
package org.nwapw.abacus.exception;
|
||||
|
||||
/**
|
||||
* An exception thrown primarily from Tree Value operators and functions,
|
||||
* which have to deal with the result of a Reducer as well as the results
|
||||
* of Applicable.
|
||||
* An exception thrown from TreeReducers.
|
||||
*/
|
||||
public class EvaluationException extends AbacusException {
|
||||
public class ReductionException extends AbacusException {
|
||||
|
||||
/**
|
||||
* Creates a new EvaluationException with the default string.
|
||||
*/
|
||||
public EvaluationException() {
|
||||
public ReductionException() {
|
||||
this("");
|
||||
}
|
||||
|
||||
@@ -18,7 +16,7 @@ public class EvaluationException extends AbacusException {
|
||||
* Creates a new EvaluationError with the given message string.
|
||||
* @param message the message string.
|
||||
*/
|
||||
public EvaluationException(String message) {
|
||||
public ReductionException(String message) {
|
||||
super("Evaluation error", message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user