Skip to content

Commit 0651383

Browse files
committed
fix: fix stacktrace when not in Lustre
Signed-off-by: Guillaume Hivert <[email protected]>
1 parent 67694ff commit 0651383

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/helpers.ffi.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export function getFunctionName() {
1515
const stack = error.stack ?? ''
1616
const parts = stack.split('\n')
1717
const end = parts.findIndex((l) => l.includes('LustreClientApplication'))
18-
const st = parts.slice(1, end).join('\n')
18+
const endIndex = end === -1 ? parts.length : end
19+
const st = parts.slice(1, endIndex).join('\n')
1920
return st
2021
}
2122

0 commit comments

Comments
 (0)