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:
1 file changed
+1
-7
@@ -45,13 +45,7 @@ export function SentryInit() {
|
|||||||
Sentry.init({
|
Sentry.init({
|
||||||
beforeSend: (event) => {
|
beforeSend: (event) => {
|
||||||
// default to false, in case instance of UserStore is not created (yet)
|
// default to false, in case instance of UserStore is not created (yet)
|
||||||
let allowErrorReporting = false;
|
const allowErrorReporting = UserStore.getInstance(false)?.allowErrorReporting ?? false;
|
||||||
|
|
||||||
try {
|
|
||||||
allowErrorReporting = UserStore.getInstance()?.allowErrorReporting;
|
|
||||||
} catch {
|
|
||||||
// ignore the TypeError throw by UserStore.getInstance()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (allowErrorReporting) {
|
if (allowErrorReporting) {
|
||||||
return event;
|
return event;
|
||||||
|
|||||||
Reference in new issue
Block a user