11"use strict" ;
2- Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
32const plugin_base_1 = require ( "@iobroker/plugin-base" ) ;
43class SentryPlugin extends plugin_base_1 . PluginBase {
5- constructor ( ) {
6- super ( ...arguments ) ;
7- /** If plugin is enabled after all checks */
8- this . reallyEnabled = false ;
9- }
4+ /** The Sentry instance */
5+ Sentry ;
6+ /** If plugin is enabled after all checks */
7+ reallyEnabled = false ;
108 /**
119 * Register and initialize Sentry
1210 *
1311 * @param pluginConfig plugin configuration from config files
1412 */
1513 async init ( pluginConfig ) {
16- var _a , _b ;
1714 if ( ! pluginConfig . enabled ) {
1815 this . log . info ( 'Sentry Plugin disabled by user' ) ;
1916 throw new Error ( 'Sentry Plugin disabled by user' ) ;
@@ -39,11 +36,11 @@ class SentryPlugin extends plugin_base_1.PluginBase {
3936 try {
4037 hostObj = ( await this . getObject ( `system.host.${ this . parentIoPackage . common . host } ` ) ) ;
4138 }
42- catch ( _c ) {
39+ catch {
4340 // ignore
4441 }
4542 // @ts -expect-error comes with https://github.com/ioBroker/ioBroker.js-controller/pull/2738
46- if ( ( _a = hostObj === null || hostObj === void 0 ? void 0 : hostObj . common ) === null || _a === void 0 ? void 0 : _a . disableDataReporting ) {
43+ if ( hostObj ? .common ? .disableDataReporting ) {
4744 this . log . info ( 'Sentry Plugin disabled for this process because data reporting is disabled on host' ) ;
4845 throw new Error ( 'Sentry Plugin disabled for this process because data reporting is disabled on host' ) ;
4946 }
@@ -61,11 +58,11 @@ class SentryPlugin extends plugin_base_1.PluginBase {
6158 try {
6259 hostObj = ( await this . getObject ( hostObjName ) ) ;
6360 }
64- catch ( _d ) {
61+ catch {
6562 // ignore
6663 }
6764 // @ts -expect-error comes with https://github.com/ioBroker/ioBroker.js-controller/pull/2738
68- if ( ( _b = hostObj === null || hostObj === void 0 ? void 0 : hostObj . common ) === null || _b === void 0 ? void 0 : _b . disableDataReporting ) {
65+ if ( hostObj ? .common ? .disableDataReporting ) {
6966 this . log . info ( 'Sentry Plugin disabled for this process because data reporting is disabled on host' ) ;
7067 throw new Error ( 'Sentry Plugin disabled for this process because data reporting is disabled on host' ) ;
7168 }
@@ -75,7 +72,7 @@ class SentryPlugin extends plugin_base_1.PluginBase {
7572 try {
7673 systemConfig = ( await this . getObject ( 'system.config' ) ) ;
7774 }
78- catch ( _e ) {
75+ catch {
7976 // ignore
8077 }
8178 if ( ! systemConfig || ! systemConfig . common || systemConfig . common . diag === 'none' ) {
@@ -86,7 +83,7 @@ class SentryPlugin extends plugin_base_1.PluginBase {
8683 try {
8784 uuidObj = ( await this . getObject ( 'system.meta.uuid' ) ) ;
8885 }
89- catch ( _f ) {
86+ catch {
9087 // ignore
9188 }
9289 const uuid = uuidObj && uuidObj . native ? uuidObj . native . uuid : null ;
@@ -140,7 +137,7 @@ class SentryPlugin extends plugin_base_1.PluginBase {
140137 try {
141138 scope . setTag ( 'plugin-sentry' , require ( './package.json' ) . version ) ;
142139 }
143- catch ( _a ) {
140+ catch {
144141 // ignore
145142 }
146143 if ( this . iobrokerConfig ) {
@@ -232,4 +229,4 @@ class SentryPlugin extends plugin_base_1.PluginBase {
232229 return this . Sentry ;
233230 }
234231}
235- exports . default = SentryPlugin ;
232+ module . exports = SentryPlugin ;
0 commit comments