diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java')
-rw-r--r-- | src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java new file mode 100644 index 0000000..6c286fc --- /dev/null +++ b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java @@ -0,0 +1,27 @@ +package ftbsc.lll.exceptions; + +import ftbsc.lll.mapper.IMapper; + +/** + * Thrown upon failure to find the requested mapping within a loaded {@link IMapper}. + */ +public class MappingNotFoundException extends RuntimeException { + + /** + * Constructs a new mapping not found exception for the specified mapping. + * @param mapping the relevant mapping + */ + public MappingNotFoundException(String mapping) { + super(String.format("Could not find mapping for %s!", mapping)); + } + + /** + * Constructs a new mapping not found exception for the specified mapping + * with the specified reason. + * @param mapping the relevant mapping + * @param reason the reason message + */ + public MappingNotFoundException(String mapping, String reason) { + this(mapping + ": " + reason); + } +} |