Skip to content

Commit

Permalink
bug: fix stacktrace in JS
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Hivert <hivert.is.coming@gmail.com>
  • Loading branch information
ghivert committed May 14, 2024
1 parent 9d95fdf commit 7f0bcb8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/helpers.ffi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export function getFunctionName() {
if (!error.stack)
throw new Error('Unable to find the stacktrace and to infer the className')
const stack = error.stack ?? ''
return stack.split('\n').slice(1, 5).join('\n')
const parts = stack.split('\n')
const end = parts.findIndex((l) => l.includes('LustreClientApplication'))
const st = parts.slice(1, end).join('\n')
return st
}

// Compare two data structures to check if they're the same.
Expand Down

0 comments on commit 7f0bcb8

Please sign in to comment.