fix up the error message in InterpretationException

This commit is contained in:
Gavin 2023-06-12 23:31:41 +02:00 committed by Gavin King
parent 3a8e66d600
commit e2cf383f7a
1 changed files with 18 additions and 6 deletions

View File

@ -9,21 +9,33 @@ package org.hibernate.query.sqm;
import org.hibernate.QueryException; import org.hibernate.QueryException;
/** /**
* Represents a general uncaught problem performing the interpretation. This might indicate * Represents a general uncaught problem performing the interpretation.
* a semantic (user sqm) problem or a bug in the parser. * This usually indicate a semantic error in the query.
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class InterpretationException extends QueryException { public class InterpretationException extends QueryException {
public InterpretationException(String query) {
this( query, null );
}
public InterpretationException(String query, String message) {
super(
"Error interpreting query [" + message + "] [" + query + "]",
query
);
}
public InterpretationException(String query, Exception cause) { public InterpretationException(String query, Exception cause) {
super( super(
"Error interpreting query [" + query + "]; this may indicate a semantic (user query) problem or a bug in the parser", "Error interpreting query [" + cause.getMessage() + "] [" + query + "]",
query, query,
cause cause
); );
} }
/**
* @deprecated this constructor does not carry information
* about the query which caused the failure
*/
@Deprecated(since = "6.3", forRemoval = true)
public InterpretationException(String message) {
super( "Error interpreting query [" + message + "]" );
}
} }