Package io.sentry.protocol
Class SentryException
- java.lang.Object
-
- io.sentry.protocol.SentryException
-
- All Implemented Interfaces:
IUnknownPropertiesConsumer
public final class SentryException extends java.lang.Object implements IUnknownPropertiesConsumer
A single exception.Multiple values inside of an [event](#typedef-Event) represent chained exceptions and should be sorted oldest to newest. For example, consider this Python code snippet:
```python try: raise Exception("random boring invariant was not met!") except Exception as e: raise ValueError("something went wrong, help!") from e ```
`Exception` would be described first in the values list, followed by a description of `ValueError`:
```json { "exception": { "values": [ {"type": "Exception": "value": "random boring invariant was not met!"}, {"type": "ValueError", "value": "something went wrong, help!"}, ] } } ```
-
-
Constructor Summary
Constructors Constructor Description SentryException()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptUnknownProperties(@NotNull java.util.Map<java.lang.String,java.lang.Object> unknown)
@Nullable Mechanism
getMechanism()
Gets an optional mechanism that created this exception.@Nullable java.lang.String
getModule()
Gets the optional module, or package which the exception type lives in.@Nullable SentryStackTrace
getStacktrace()
Gets the stack trace.@Nullable java.lang.Long
getThreadId()
Gets an optional value which refers to a thread in the threads interface.@Nullable java.lang.String
getType()
The Exception Type.@Nullable java.lang.String
getValue()
The exception value.void
setMechanism(@Nullable Mechanism mechanism)
Sets an optional mechanism that created this exception.void
setModule(@Nullable java.lang.String module)
Sets the optional module, or package which the exception type lives in.void
setStacktrace(@Nullable SentryStackTrace stacktrace)
Sets the stack trace.void
setThreadId(@Nullable java.lang.Long threadId)
Sets an optional value which refers to a thread in the threads interface.void
setType(@Nullable java.lang.String type)
The Exception Type.void
setValue(@Nullable java.lang.String value)
The exception value
-
-
-
Method Detail
-
getType
@Nullable public @Nullable java.lang.String getType()
The Exception Type.- Returns:
- the type of the exception.
-
setType
public void setType(@Nullable @Nullable java.lang.String type)
The Exception Type.- Parameters:
type
- type of the exception.
-
getValue
@Nullable public @Nullable java.lang.String getValue()
The exception value.- Returns:
- the value.
-
setValue
public void setValue(@Nullable @Nullable java.lang.String value)
The exception value- Parameters:
value
- The exception message
-
getModule
@Nullable public @Nullable java.lang.String getModule()
Gets the optional module, or package which the exception type lives in.- Returns:
- the module.
-
setModule
public void setModule(@Nullable @Nullable java.lang.String module)
Sets the optional module, or package which the exception type lives in.- Parameters:
module
- the module.
-
getThreadId
@Nullable public @Nullable java.lang.Long getThreadId()
Gets an optional value which refers to a thread in the threads interface.- Returns:
- the thread id.
-
setThreadId
public void setThreadId(@Nullable @Nullable java.lang.Long threadId)
Sets an optional value which refers to a thread in the threads interface.- Parameters:
threadId
- the thread id.
-
getStacktrace
@Nullable public @Nullable SentryStackTrace getStacktrace()
Gets the stack trace.- Returns:
- the stacktrace.
-
setStacktrace
public void setStacktrace(@Nullable @Nullable SentryStackTrace stacktrace)
Sets the stack trace.- Parameters:
stacktrace
- the stacktrace of the exception.
-
getMechanism
@Nullable public @Nullable Mechanism getMechanism()
Gets an optional mechanism that created this exception.- Returns:
- the mechanism.
-
setMechanism
public void setMechanism(@Nullable @Nullable Mechanism mechanism)
Sets an optional mechanism that created this exception.- Parameters:
mechanism
- the mechanism.
-
acceptUnknownProperties
@Internal public void acceptUnknownProperties(@NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> unknown)
- Specified by:
acceptUnknownProperties
in interfaceIUnknownPropertiesConsumer
-
-