Class SentryStackTrace
- All Implemented Interfaces:
JsonSerializable,JsonUnknown
A stack trace contains a list of frames, each with various bits (most optional) describing the context of that frame. Frames should be sorted from oldest to newest.
For the given example program written in Python:
```python def foo(): my_var = 'foo' raise ValueError()
def main(): foo() ```
A minimalistic stack trace for the above program in the correct order:
```json { "frames": [ {"function": "main"}, {"function": "foo"} ] } ```
The top frame fully symbolicated with five lines of source context:
```json { "frames": [{ "in_app": true, "function": "myfunction", "abs_path": "/real/file/name.py", "filename": "file/name.py", "lineno": 3, "vars": { "my_var": "'value'" }, "pre_context": [ "def foo():", " my_var = 'foo'", ], "context_line": " raise ValueError()", "post_context": [ "", "def main():" ], }] } ```
A minimal native stack trace with register values. Note that the `package` event attribute must be "native" for these frames to be symbolicated.
```json { "frames": [ {"instruction_addr": "0x7fff5bf3456c"}, {"instruction_addr": "0x7fff5bf346c0"}, ], "registers": { "rip": "0x00007ff6eef54be2", "rsp": "0x0000003b710cd9e0" } } ```
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable List<SentryStackFrame>Gets the frames of this stacktrace.@Nullable Booleanvoidserialize(@NotNull ObjectWriter writer, @NotNull ILogger logger) voidsetFrames(@Nullable List<SentryStackFrame> frames) Sets the frames of this stacktrace.voidsetRegisters(@Nullable Map<String, String> registers) voidsetSnapshot(@Nullable Boolean snapshot) voidsetUnknown(@Nullable Map<String, Object> unknown)
-
Constructor Details
-
SentryStackTrace
public SentryStackTrace() -
SentryStackTrace
-
-
Method Details
-
getFrames
Gets the frames of this stacktrace.- Returns:
- the frames.
-
setFrames
Sets the frames of this stacktrace.- Parameters:
frames- the frames.
-
getRegisters
-
setRegisters
-
getSnapshot
-
setSnapshot
-
getUnknown
- Specified by:
getUnknownin interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknownin interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull ObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serializein interfaceJsonSerializable- Throws:
IOException
-