mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
throw a new wrapped error instead of default one from segment (#10118)
This commit is contained in:
parent
2f6f8966bb
commit
64adcae08d
@ -265,7 +265,13 @@ export default class MetaMetricsController {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const callback = (err) => {
|
const callback = (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err)
|
// The error that segment gives us has some manipulation done to it
|
||||||
|
// that seemingly breaks with lockdown enabled. Creating a new error
|
||||||
|
// here prevents the system from freezing when the network request to
|
||||||
|
// segment fails for any reason.
|
||||||
|
const safeError = new Error(err.message)
|
||||||
|
safeError.stack = err.stack
|
||||||
|
return reject(safeError)
|
||||||
}
|
}
|
||||||
return resolve()
|
return resolve()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user