src/bugsnag: simplify the function

Thanks-to: Jacob <The God of JS> Marshall