Skip to content

Commit

Permalink
setup SentryIO (Raven)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensayshi committed Feb 12, 2018
1 parent 2d479c9 commit 0944f6f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
3 changes: 2 additions & 1 deletion appconfig.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"https://www.glidera.io",
"https://sandbox.glidera.io",
"https://buy.btc.com",
"https://checkout.simplexcc.com"
"https://checkout.simplexcc.com",
"https://sentry.io"
],

"GLIDERA_URL": "https://www.glidera.io",
Expand Down
1 change: 1 addition & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<access origin="https://www.glidera.io"/>
<access origin="https://bitonic.nl"/>
<access origin="https://staging.bitonic.nl"/>
<access origin="https://sentry.io"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
Expand Down
4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ gulp.task('js:libs', ['appconfig'], function() {
"./src/lib/angular-moment/angular-moment.js",
"./src/lib/ngImgCrop/compile/unminified/ng-img-crop.js",
"./src/lib/qrcode/lib/qrcode.js",
"./src/lib/angular-qr/src/angular-qr.js"
"./src/lib/angular-qr/src/angular-qr.js",
"./src/lib/raven-js/dist/raven.js",
"./src/lib/raven-js/dist/plugins/angular.js"
])
.pipe(concat('libs.js'))
.pipe(sourcemaps.init({largeFile: true}))
Expand Down
1 change: 1 addition & 0 deletions platforms/android/res/xml/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
<access origin="https://www.glidera.io" />
<access origin="https://bitonic.nl" />
<access origin="https://staging.bitonic.nl" />
<access origin="https://sentry.io" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
Expand Down
21 changes: 21 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@
angular.module('blocktrail.translations', []).constant('TRANSLATIONS', <%= TRANSLATIONS %>);
</script>

<% if (APPCONFIG.SENTRY_TRACKING_URL) { %>
<script>
Raven
.config('<%= APPCONFIG.SENTRY_TRACKING_URL %>', {release: '<%= VERSION %>', dataCallback: function(data) {
data.request.url = data.request.url.replace(/([&?])token=.+?[&]/, "$1");
if (data.stacktrace) {
data.stacktrace.frames.forEach(function(frame) {
frame.filename = frame.filename.replace(/([&?])token=.+?[&]/, "$1");
});
}
return data;
}})
.addPlugin(Raven.Plugins.Angular)
.install();
</script>
<% } else { %>
<script>
// unset Raven because we won't be initializing it
window.Raven = null;
</script>
<% } %>
<script>
document.addEventListener("deviceready", function() {
console.log('deviceready');
Expand Down
4 changes: 4 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ angular.module('blocktrail.wallet').run(
$rootScope.$on("$stateChangeError", function(event, toState, toParams, fromState, fromParams, error) {
$log.debug("$stateChangeError" + toState.name + " from " + fromState.name, toState, fromState, error);
$state.go('app.error');

if (window.Raven) {
Raven.captureException(error);
}
});

$log.debug('window.sqlitePlugin? ' + !!window.sqlitePlugin);
Expand Down

0 comments on commit 0944f6f

Please sign in to comment.