LoginSystem/src/main/java/fr/xephi/authme/service/yaml/YamlParseException.java
ljacqu 329657bd5f
#1497 Show specific message for invalid YAML files (#1506)
* #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
2018-02-23 23:31:22 +01:00

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;
}
}