public class SoySyntaxException extends RuntimeException
Important: Users outside of Soy code may call the getters on a SoySyntaxException object created by the Soy compiler, but should not create or mutate SoySyntaxException objects themselves (treat constructors, creation functions, and mutating methods as superpackage-private).
| Modifier | Constructor and Description |
|---|---|
|
SoySyntaxException(String message)
Deprecated.
Do not use outside of Soy code (treat as superpackage-private).
|
protected |
SoySyntaxException(String message,
Throwable cause)
Important: Do not use outside of Soy code (treat as superpackage-private).
|
protected |
SoySyntaxException(Throwable cause)
Important: Do not use outside of Soy code (treat as superpackage-private).
|
| Modifier and Type | Method and Description |
|---|---|
SoySyntaxException |
associateMetaInfo(SourceLocation srcLoc,
String filePath,
String templateName)
Important: Do not use outside of Soy code (treat as superpackage-private).
|
static SoySyntaxException |
createCausedWithoutMetaInfo(String message,
Throwable cause)
Deprecated.
Prefer
#createCausedWithMetaInfo. There's no good reason for not knowing
where an error came from. |
static SoySyntaxException |
createWithMetaInfo(String message,
SourceLocation srcLoc)
Important: Do not use outside of Soy code (treat as superpackage-private).
|
static SoySyntaxException |
createWithMetaInfo(String message,
SourceLocation srcLoc,
String filePath,
String templateName)
Important: Do not use outside of Soy code (treat as superpackage-private).
|
static SoySyntaxException |
createWithoutMetaInfo(String message)
Deprecated.
Prefer
createWithMetaInfo(java.lang.String, com.google.template.soy.base.SourceLocation). There's no good reason for not knowing
where an error comes from. |
String |
getMessage() |
SourceLocation |
getSourceLocation()
The source location at which the error occurred or
SourceLocation.UNKNOWN. |
String |
getTemplateName()
The name of the template in which the problem occurred or
null if not known. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString@Deprecated public SoySyntaxException(String message)
Important: Do not use outside of Soy code (treat as superpackage-private).
message - A detailed description of what the syntax error is.protected SoySyntaxException(String message, Throwable cause)
Important: Do not use outside of Soy code (treat as superpackage-private).
message - A detailed description of what the syntax error is.cause - The Throwable underlying this syntax error.protected SoySyntaxException(Throwable cause)
Important: Do not use outside of Soy code (treat as superpackage-private).
Note: For this constructor, the message will be set to the cause's message.
cause - The Throwable underlying this syntax error.@Deprecated public static SoySyntaxException createWithoutMetaInfo(String message)
createWithMetaInfo(java.lang.String, com.google.template.soy.base.SourceLocation). There's no good reason for not knowing
where an error comes from.Important: Do not use outside of Soy code (treat as superpackage-private).
message - The error message.@Deprecated public static SoySyntaxException createCausedWithoutMetaInfo(@Nullable String message, Throwable cause)
#createCausedWithMetaInfo. There's no good reason for not knowing
where an error came from.Important: Do not use outside of Soy code (treat as superpackage-private).
message - The error message, or null to use the message from the cause.cause - The cause of this exception.public static SoySyntaxException createWithMetaInfo(String message, SourceLocation srcLoc)
Important: Do not use outside of Soy code (treat as superpackage-private).
message - The error message.srcLoc - The source location of the error, or null if unknown.public static SoySyntaxException createWithMetaInfo(String message, @Nullable SourceLocation srcLoc, @Nullable String filePath, @Nullable String templateName)
Important: Do not use outside of Soy code (treat as superpackage-private).
message - The error message.srcLoc - The source location of the error, or null if unknown. At most one of srcLoc and
filePath may be nonnull (prefer srcLoc since it contains more info).filePath - The file path of the file containing the error. At most one of srcLoc and
filePath may be nonnull (prefer srcLoc since it contains more info).templateName - The name of the template containing the error, or null if not available.public SoySyntaxException associateMetaInfo(@Nullable SourceLocation srcLoc, @Nullable String filePath, @Nullable String templateName)
Important: Do not use outside of Soy code (treat as superpackage-private).
srcLoc - The source location of the error, or null if unknown. At most one of srcLoc and
filePath may be nonnull (prefer srcLoc since it contains more info).filePath - The file path of the file containing the error. At most one of srcLoc and
filePath may be nonnull (prefer srcLoc since it contains more info).templateName - The name of the template containing the error, or null if not available.public SourceLocation getSourceLocation()
SourceLocation.UNKNOWN.@Nullable public String getTemplateName()
null if not known.public String getMessage()
getMessage in class Throwable