mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
13 lines
322 B
TypeScript
13 lines
322 B
TypeScript
import type {Thread} from 'sentry/types';
|
|
|
|
function findBestThread(threads: Thread[]) {
|
|
// search the entire threads list for a crashed thread with stack trace
|
|
return (
|
|
threads.find(thread => thread.crashed) ||
|
|
threads.find(thread => thread.stacktrace) ||
|
|
threads[0]
|
|
);
|
|
}
|
|
|
|
export default findBestThread;
|