1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-09-25 12:52:33 +00:00

Add a DomainException that avoids using null in functions.

This commit is contained in:
2017-09-01 18:23:44 -07:00
parent 9ddfeb02cf
commit 9c77fa8aeb
4 changed files with 34 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
package org.nwapw.abacus.number;
/**
* Exception thrown if the function parameters do not match
* requirements.
*/
public class DomainException extends RuntimeException {
/**
* Creates a new DomainException.
* @param reason the reason for which the exception is thrown.
*/
public DomainException(String reason) {
super(reason);
}
/**
* Creates a new DomainException with a default message.
*/
public DomainException(){
this("Domain Error");
}
}