-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,15 @@ | |
* the root directory of this source tree. | ||
*/ | ||
|
||
import * as Sentry from '@sentry/node'; | ||
import * as pioNodeHelpers from 'platformio-node-helpers'; | ||
|
||
import os from 'os'; | ||
import vscode from 'vscode'; | ||
|
||
|
||
export async function notifyError(title, err) { | ||
this.notifySentry(err); | ||
const description = err.stack || err.toString(); | ||
const action = 'Report a problem'; | ||
const selected = await vscode.window.showErrorMessage(description, action); | ||
|
@@ -39,6 +41,19 @@ ${description} | |
console.error(err); | ||
} | ||
|
||
export function notifySentry(err) { | ||
Sentry.init({ | ||
dsn: 'https://[email protected]/1309812', | ||
release: getIDEVersion(), | ||
serverName: `${os.type()}, ${os.release()}, ${os.arch()}` | ||
|
||
}); | ||
Sentry.configureScope((scope) => { | ||
scope.setTag('vscode', vscode.version); | ||
}); | ||
Sentry.captureException(err); | ||
} | ||
|
||
export function getIDEManifest() { | ||
return vscode.extensions.getExtension('platformio.platformio-ide').packageJSON; | ||
} | ||
|