The API provides a way to parses an Error.stack into an array of StackFrame. However, as far as I can tell, it does not provide a way to convert an array of StackFrame back into a simple Error.stack.
Expected Behavior
The API should be able to convert either direction between an array of StackFrame and Error.stack.
Current Behavior
The API can only convert Error.stack into an array of StackFrame.
Context
There are times you need to generate an array of StackFrame and then push that into a regular Error object for usage downstream by code that does not know how to handle StackFrame objects.
The API provides a way to parses an
Error.stackinto an array ofStackFrame. However, as far as I can tell, it does not provide a way to convert an array ofStackFrameback into a simpleError.stack.Expected Behavior
The API should be able to convert either direction between an array of
StackFrameandError.stack.Current Behavior
The API can only convert
Error.stackinto an array ofStackFrame.Context
There are times you need to generate an array of
StackFrameand then push that into a regularErrorobject for usage downstream by code that does not know how to handleStackFrameobjects.