-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* source map, webpack, stories, babel * fixed jest tests * hot reload * set up * getplatform func * configured * initialized * test error dev * test error dev removed * webpack plugin removed * refactored * after review * separated error and stacktarce * platform on back * .
- Loading branch information
1 parent
1017cee
commit 17d714c
Showing
6 changed files
with
378 additions
and
100 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import MoiraApi from "../Api/MoiraApi"; | ||
import * as Sentry from "@sentry/react"; | ||
|
||
const getDSNConfig = async (api: MoiraApi) => { | ||
try { | ||
const res = await api.getConfig(); | ||
return res.sentry; | ||
} catch (error) { | ||
return Promise.reject("Error getting DSN"); | ||
} | ||
}; | ||
|
||
export const initSentry = async (api: MoiraApi) => { | ||
const config = await getDSNConfig(api); | ||
if (!config) { | ||
return; | ||
} | ||
|
||
const { dsn, platform } = config; | ||
const isLocalPlatform = platform !== undefined; | ||
Sentry.init({ | ||
dsn, | ||
debug: isLocalPlatform, | ||
environment: platform, | ||
enabled: !isLocalPlatform, | ||
tracesSampleRate: 1.0, | ||
}); | ||
}; |
Oops, something went wrong.