findBestThread.tsx 322 B

123456789101112
  1. import {Thread} from 'sentry/types';
  2. function findBestThread(threads: Array<Thread>) {
  3. // search the entire threads list for a crashed thread with stack trace
  4. return (
  5. threads.find(thread => thread.crashed) ||
  6. threads.find(thread => thread.stacktrace) ||
  7. threads[0]
  8. );
  9. }
  10. export default findBestThread;