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) { } catch (err) {
this.send(err.message, msg.data.id, true) this.send(err.message, msg.data.id, true)
// TODO: Allow passing method/message as an extra context logError(Errors._901, err.message, {
// Tweak CodedException class to accept it as a second argument contexts: {
logError(Errors._901, `${msg.data.method} ${err.message}`) safeApp: this.app,
request: msg.data,
},
})
} }
} }
} }

View File

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