feat(lib/utils/errors): add getCurrentStack

This commit is contained in:
PalmDevs 2025-06-12 23:23:16 +07:00
parent ba835cdfbc
commit b4923296e5
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -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')
}