Package software.amazon.smithy.model
Class SourceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- software.amazon.smithy.model.SourceException
-
- All Implemented Interfaces:
java.io.Serializable
,FromSourceLocation
- Direct Known Subclasses:
ExpectationNotMetException
,ModelSyntaxException
,NodeDeserializationException
,UseException
public class SourceException extends java.lang.RuntimeException implements FromSourceLocation
An exception that can be traced back to aSourceLocation
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SourceException(java.lang.String message, FromSourceLocation sourceLocation)
SourceException(java.lang.String message, FromSourceLocation sourceLocation, java.lang.Throwable cause)
-
Method Summary
Modifier and Type Method Description java.lang.String
getMessageWithoutLocation()
Retrieves the message for this exception without the appended source location.SourceLocation
getSourceLocation()
Gets the source location of a value.
-
-
-
Constructor Detail
-
SourceException
public SourceException(java.lang.String message, FromSourceLocation sourceLocation, java.lang.Throwable cause)
-
SourceException
public SourceException(java.lang.String message, FromSourceLocation sourceLocation)
-
-
Method Detail
-
getSourceLocation
public SourceLocation getSourceLocation()
Description copied from interface:FromSourceLocation
Gets the source location of a value.- Specified by:
getSourceLocation
in interfaceFromSourceLocation
- Returns:
- Returns the source location of the value.
-
getMessageWithoutLocation
public java.lang.String getMessageWithoutLocation()
Retrieves the message for this exception without the appended source location.- Returns:
- The trimmed message.
-
-