Skip to content
Snippets Groups Projects
Unverified Commit 4111e631 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Add function getStackTrace

parent f45968ca
No related branches found
No related tags found
No related merge requests found
Pipeline #27599 failed
...@@ -132,3 +132,14 @@ export const errorMixin = { ...@@ -132,3 +132,14 @@ export const errorMixin = {
} }
} }
}; };
/**
* Returns the stack trace as array
*
* @returns {string[]}
*/
export const getStackTrace = () => {
let stack = new Error().stack || '';
stack = stack.split('\n').map(function (line) { return line.trim(); });
return stack.splice(stack[0] === 'Error' ? 2 : 1);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment