diff options
| author | Jan Tuomi <jan-sebastian.tuomi@aalto.fi> | 2016-08-02 21:45:09 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan-sebastian.tuomi@aalto.fi> | 2016-08-02 21:45:09 +0300 |
| commit | 5ac4b67b7eba39bbb098b9b184dcacffe99baa2a (patch) | |
| tree | 0b2df0878bc26d3916603fc15a75410c310c26d1 /src/main/com/jantuomi/tunkki/exception | |
| parent | 262e87fb313e4636a07544df152db0f8bcbca381 (diff) | |
Add division by zero error
Diffstat (limited to 'src/main/com/jantuomi/tunkki/exception')
| -rw-r--r-- | src/main/com/jantuomi/tunkki/exception/TunkkiError.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/com/jantuomi/tunkki/exception/TunkkiError.java b/src/main/com/jantuomi/tunkki/exception/TunkkiError.java index affc353..b5a36a7 100644 --- a/src/main/com/jantuomi/tunkki/exception/TunkkiError.java +++ b/src/main/com/jantuomi/tunkki/exception/TunkkiError.java @@ -20,7 +20,9 @@ public class TunkkiError extends Exception { UndeclaredSymbolError, IncludeError, GeneralError, - CastError, NadaError + CastError, + DivisionByZeroError, + NadaError } private static Map<ExceptionType, String> errorTexts = new HashMap<>(); @@ -36,6 +38,7 @@ public class TunkkiError extends Exception { errorTexts.put(ExceptionType.GeneralError, "%s"); errorTexts.put(ExceptionType.NadaError, "Can't do operation with a nada value."); errorTexts.put(ExceptionType.CastError, "Illegal cast to type %s from value %s."); + errorTexts.put(ExceptionType.DivisionByZeroError, "Division by zero."); } private ExceptionType exceptionType; |
