* #1497 Throw dedicated exception for invalid YAML files and handle it on startup - Wrap SnakeYAML exceptions when loading config.yml and commands.yml on startup into own exception type - Handle exception type on startup with specific error message * #1497 Fix inaccurate JavaDoc comment
27 lines
623 B
Java
27 lines
623 B
Java
package fr.xephi.authme.service.yaml;
|
|
|
|
import org.yaml.snakeyaml.parser.ParserException;
|
|
|
|
/**
|
|
* Exception when a YAML file could not be parsed.
|
|
*/
|
|
public class YamlParseException extends RuntimeException {
|
|
|
|
private final String file;
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param file the file a parsing exception occurred with
|
|
* @param snakeYamlException the caught exception from SnakeYAML
|
|
*/
|
|
public YamlParseException(String file, ParserException snakeYamlException) {
|
|
super(snakeYamlException);
|
|
this.file = file;
|
|
}
|
|
|
|
public String getFile() {
|
|
return file;
|
|
}
|
|
}
|