erquhartE
Convex Communityβ€’3y agoβ€’
6 replies
erquhart

Printing a stack trace in convex runtime

I'm trying to catch an error from a mutation but still log the stack trace. It looks like the stack property isn't present on the error object, and err.trace() just gets the location of the catch.

    } catch (e) {
      await db.patch(migration._id, { status: 'error', error: e?.toString() })
      console.error(e) // message only (as expected)
      console.trace() // traces to the catch, one line deep
      console.error(e.stack) // empty string
    }
Was this page helpful?