diff --git a/lib/utils/src/errors.ts b/lib/utils/src/errors.ts index 836dc3a..610d2e3 100644 --- a/lib/utils/src/errors.ts +++ b/lib/utils/src/errors.ts @@ -1,3 +1,8 @@ export function getErrorStack(e: unknown) { return e instanceof Error ? e.stack : String(e) } + +export function getCurrentStack() { + const { stack } = new Error() + return stack!.split('\n').slice(2).join('\n') +}