Feature: Better error handling for Safe apps things (#2340)

* handle request/app fetch errors

* shorted extraMessage for app fetch error

* use context instead of extra for safe app url exception when fetching

* app -> safeApp for sentry context
This commit is contained in:
Mikhail Mikheev 2021-06-01 14:10:57 +04:00 committed by GitHub
parent 1758cb34c3
commit cc345946e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -69,9 +69,12 @@ class AppCommunicator {
}
} catch (err) {
this.send(err.message, msg.data.id, true)
// TODO: Allow passing method/message as an extra context
// Tweak CodedException class to accept it as a second argument
logError(Errors._901, `${msg.data.method} ${err.message}`)
logError(Errors._901, err.message, {
contexts: {
safeApp: this.app,
request: msg.data,
},
})
}
}
}

View File

@ -274,7 +274,13 @@ export const getAppInfoFromUrl = memoize(
}
return res
} catch (error) {
logError(Errors._900, `${res.url}: ${error.message}`, undefined, false)
logError(Errors._900, error.message, {
contexts: {
safeApp: {
url: appUrl,
},
},
})
return res
}
},