24 lines
635 B
Java
24 lines
635 B
Java
package ch.fritteli.gombaila.domain.generator;
|
|
|
|
import ch.fritteli.gombaila.domain.common.Node;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
public class GeneratorException extends RuntimeException {
|
|
@NotNull
|
|
private final Node node;
|
|
|
|
public GeneratorException(@Nullable final String s, @NotNull final Node node) {
|
|
super(s);
|
|
this.node = node;
|
|
}
|
|
|
|
@Override
|
|
public String getMessage() {
|
|
return "Generator error at node '%s': %s".formatted(
|
|
this.node.getClass().getSimpleName(),
|
|
super.getMessage()
|
|
);
|
|
}
|
|
}
|