mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
20 lines
389 B
TypeScript
20 lines
389 B
TypeScript
import type {StacktraceType, Thread} from 'sentry/types';
|
|
|
|
function getThreadStacktrace(raw: boolean, thread?: Thread): StacktraceType | undefined {
|
|
if (!thread) {
|
|
return undefined;
|
|
}
|
|
|
|
if (raw && thread.rawStacktrace) {
|
|
return thread.rawStacktrace;
|
|
}
|
|
|
|
if (thread.stacktrace) {
|
|
return thread.stacktrace;
|
|
}
|
|
|
|
return undefined;
|
|
}
|
|
|
|
export default getThreadStacktrace;
|