1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove try...catch block

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen 2021-07-12 14:39:35 +03:00
parent ec8c3bc26d
commit a0296d606d
No known key found for this signature in database
GPG Key ID: 54B44603D251B788

View File

@ -45,13 +45,7 @@ export function SentryInit() {
Sentry.init({
beforeSend: (event) => {
// default to false, in case instance of UserStore is not created (yet)
let allowErrorReporting = false;
try {
allowErrorReporting = UserStore.getInstance()?.allowErrorReporting;
} catch {
// ignore the TypeError throw by UserStore.getInstance()
}
const allowErrorReporting = UserStore.getInstance(false)?.allowErrorReporting ?? false;
if (allowErrorReporting) {
return event;