Open ieow opened 8 months ago
React Native app crashed when try to access stack field in the error object
stack
in reactNative ( version 0.72.0 )
to reproduce (in react native)
import {rpcErrors} from '@metamask/rpc-errors'; try { let err = rpcErrors.invalidRequest(); console.log(err.stack); } catch (error) { console.log(error); }
Accessing stack in Error class works fine
Error
try { let err = new Error("error message"); console.log(err.stack); } catch (error) { console.log(error); }
+1
Assigning a potentially cyclic object directly to serialized.stack is not safe.
serialized.stack
Suggestion: Perform explicit serialization of the stack with a max-depth of recursion, or prune the reference.
React Native app crashed when try to access
stack
field in the error objectin reactNative ( version 0.72.0 )
to reproduce (in react native)
Accessing
stack
inError
class works fine