Skip to content

Commit

Permalink
#406 Deprecated Sentry stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
raintonr committed Mar 30, 2023
1 parent 186be8e commit 1e16d8e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
3 changes: 1 addition & 2 deletions build/controls/Unknown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/controls/Unknown.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as SentryNode from '@sentry/node';
import { Control } from '../structure-file';
import { ControlBase, ControlType } from './control-base';

Expand All @@ -20,7 +19,7 @@ export class Unknown extends ControlBase {
const sentry = this.adapter.getSentry();
sentry?.withScope((scope) => {
scope.setExtra('control', JSON.stringify(control, null, 2));
sentry.captureMessage(msg, SentryNode.Severity.Warning);
sentry.captureMessage(msg, 'warning');
});
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export class Loxone extends utils.Adapter {
const sentry = this.getSentry();
sentry?.withScope((scope) => {
scope.setExtra('state', state);
sentry.captureMessage(msg, SentryNode.Severity.Warning);
sentry.captureMessage(msg, 'warning');
});
}
} else if (!this.lxConnected) {
Expand Down Expand Up @@ -428,7 +428,7 @@ export class Loxone extends utils.Adapter {
type: 'debug',
category: 'started',
message: `Structure file added to event ${attachmentEventId}`,
level: SentryNode.Severity.Info,
level: 'info',
});
}
return event;
Expand All @@ -440,10 +440,10 @@ export class Loxone extends utils.Adapter {

attachmentEventId = event.event_id;

const { host, path, projectId, port, protocol, user } = dsn;
const { host, path, projectId, port, protocol, publicKey } = dsn;
const endpoint = `${protocol}://${host}${port !== '' ? `:${port}` : ''}${
path !== '' ? `/${path}` : ''
}/api/${projectId}/events/${attachmentEventId}/attachments/?sentry_key=${user}&sentry_version=7&sentry_client=custom-javascript`;
}/api/${projectId}/events/${attachmentEventId}/attachments/?sentry_key=${publicKey}&sentry_version=7&sentry_client=custom-javascript`;

const form = new FormData();
form.append('att', JSON.stringify(data, null, 2), {
Expand Down Expand Up @@ -1041,7 +1041,7 @@ export class Loxone extends utils.Adapter {

public reportError(message: string): void {
this.log.error(message);
this.getSentry()?.captureMessage(message, SentryNode.Severity.Error);
this.getSentry()?.captureMessage(message, 'error');
}
}

Expand Down

0 comments on commit 1e16d8e

Please sign in to comment.