Skip to content

Commit

Permalink
Merge pull request #138 from ezraroi/131-integrate-sentry
Browse files Browse the repository at this point in the history
added sentry
  • Loading branch information
ezraroi authored Sep 21, 2024
2 parents 1f94e08 + 74f6198 commit 28dc9d6
Show file tree
Hide file tree
Showing 10 changed files with 2,893 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Mundialito/Client/lib/sentry/angular.min.js

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

3 changes: 3 additions & 0 deletions Mundialito/Client/lib/sentry/bundle.min.js

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions Mundialito/Client/src/General/ErrorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ angular.module('mundialitoApp').factory('ErrorHandler', ['$rootScope', '$log', '
}])
.factory('myHttpInterceptor', ['ErrorHandler', '$q', function (ErrorHandler, $q) {
return {
response: function (response) {
return response;
},
responseError: function (response) {
response: (response) => response,
responseError: (response) => {
ErrorHandler.handle(response.data, response.status, response.headers, response.config);

Sentry.captureException(response.data);
// do something on error
return $q.reject(response);
}
Expand Down
2 changes: 1 addition & 1 deletion Mundialito/Client/src/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module('mundialitoApp', ['key-value-editor', 'security', 'ngSanitize', 'ngRoute', 'ngAnimate', 'ui.bootstrap', 'autofields.bootstrap', 'cgBusy', 'ajoslin.promise-tracker', 'ui.select',
'ui.bootstrap.datetimepicker', 'ui.grid', 'ui.grid.autoResize', 'googlechart', 'toaster', 'ui.grid.saveState', 'ui.grid.resizeColumns','ui.toggle'])
'ui.bootstrap.datetimepicker', 'ui.grid', 'ui.grid.autoResize', 'googlechart', 'toaster', 'ui.grid.saveState', 'ui.grid.resizeColumns','ui.toggle', 'ngSentry'])
.value('cgBusyTemplateName', 'App/Partials/angular-busy.html')
.config(['$routeProvider', '$httpProvider', '$locationProvider', '$parseProvider', 'securityProvider', 'Constants', function ($routeProvider, $httpProvider, $locationProvider, $parseProvider, securityProvider, Constants) {
$locationProvider.html5Mode(true);
Expand Down
17 changes: 14 additions & 3 deletions Mundialito/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>@Model.ApplicationName</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="google-signin-client_id" content="@Model.GoogleClientId">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
Expand All @@ -33,6 +33,7 @@
</head>

<body>

<script src="//accounts.google.com/gsi/client"></script>
<div class="container body-content">
<!-- App Loading message -->
Expand Down Expand Up @@ -141,16 +142,26 @@
</div>
<!-- End of Content Loading message -->
</div>
<script src="sentry/bundle.min.js" crossorigin="anonymous"></script>
<!-- If you include the integration it will be available under Sentry.Integrations.Angular -->
<script src="sentry/angular.min.js" crossorigin="anonymous"></script>
<!-- End of Main Content -->
@if (env.IsProduction())
{
<script src="lib/lib-min-2d5e40df8764ea1d842fca768d139b58.js"></script>
<script src="js/app-min-b9de64167c2b03c8f2f816e6e633631e.js"></script>
<script src="js/app-min-dbea857653a57fb18c602c8a4373eee2.js"></script>
}
else {
<script src="lib/lib-77990d6df268e8d3d432fb52597000f9.js"></script>
<script src="js/app-06c454b6fe15193adf661d79a88ef6c0.js"></script>
<script src="js/app-d59627e3e8cd8f2d05420f29a89370ce.js"></script>
}
<script>
Sentry.init({
dsn: "https://31394e9c4dd78c0bfb7d7f5324d68664@o4507974958448640.ingest.de.sentry.io/4507975304413264",
integrations: [new Sentry.Integrations.Angular()],
});
</script>
</div>
</body>
Expand Down
8 changes: 7 additions & 1 deletion Mundialito/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ gulp.task('copy-templates', function () {
.pipe(gulp.dest('wwwroot/'));
});

gulp.task('copy-sentry', function () {
return gulp.src(['Client/lib/sentry/*.js'])
.pipe(gulp.dest('wwwroot/sentry'));
});


gulp.task('cache-bust-lib', () => {
const libPattern = /^lib-[a-z0-9]+\.js$/;
let lib = fs.readdirSync('wwwroot/lib').filter(fileName => {
Expand Down Expand Up @@ -156,4 +162,4 @@ gulp.task('cache-bust-app-min', () => {
gulp.task('clean', () => gulp.src(['wwwroot/js/*.js', 'wwwroot/lib/*.js'], { read: false })
.pipe(clean()));

gulp.task('default', gulp.series(['clean', 'build-css-cerulean', 'build-css-space-lab', 'compress-lib', 'compress-app', 'copy-html', 'copy-templates', 'cache-bust-lib', 'cache-bust-lib-min', 'cache-bust-app', 'cache-bust-app-min']));
gulp.task('default', gulp.series(['clean', 'build-css-cerulean', 'build-css-space-lab', 'compress-lib', 'compress-app', 'copy-html', 'copy-templates', 'copy-sentry', 'cache-bust-lib', 'cache-bust-lib-min', 'cache-bust-app', 'cache-bust-app-min']));
Loading

0 comments on commit 28dc9d6

Please sign in to comment.