Files
2024-02-15 17:01:50 +00:00

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;