I want to extend RuntimeException to create this specific exception:
class CompileLinkException extends RuntimeException {
CompileLinkException(int shader) {
int infoLogLength = glGetShader(shader, GL_INFO_LOG_LENGTH);
String strInfoLog = glGetShaderInfoLog(shader, infoLogLength);
// set exception message = strInfoLog
glDeleteShader(shader);
}
}
How do i set a custom exception message? The only way i know is to call
super(message)
but this instruction must be the first statement in the constructor.
You could do something like this: