Yet another collection of commonly used exceptions for java applications.
Note that all of these exceptions are unchecked. This is on purpose, but we strongly encourage you to write javadoc strings on your functions that may throw these exceptions, so that it's still transparent.
All exceptions can be trivially constructed with no arguments, but underlying exception and error messages can also be provided.
First, you need to add the library to your project:
// Add mavenCentral to your repositories
repositories {
mavenCentral();
}
// Add the library (NOTE: Check the latest version on github)
depdendencies {
implementation group: 'dk.yalibs', name: 'yaerrors', version: '1.0.0';
}
Now you can access the exceptions like so:
import dk.yalibs.yaerrors.NotFoundException; // Import it
public class Main {
public static void main(String[] argv) throws Exception {
throw NotFoundException(); // Use it
}
}