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:
parent
ec8c3bc26d
commit
a0296d606d
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user