socialnetworknews-web

A open-source Paper.li clone
git clone git://archive.git.mtrnord.blog/SocialNetworkNews/socialnetworknews-web.git
Log | Files | Refs | README | LICENSE

commit bf03bcd6df7b331e8971561b3e7db9a0bc10ba7a
parent be0a699e53febc8f038f21fc93423d7ae86263c6
Author: MTRNord <mtrnord1@gmail.com>
Date:   Mon, 26 Feb 2018 15:34:47 +0100

Change code to use Sentry

Diffstat:
Msrc/app/app.module.ts | 1+
Msrc/app/papers-list/papers-list.component.ts | 7++++++-
Msrc/app/tweet-list/tweet-list.component.ts | 10+++++++++-
3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/app/app.module.ts b/src/app/app.module.ts @@ -23,6 +23,7 @@ Raven .config('https://b760c9f9035c472998ada3a02dcc81d3@sentry.io/294520', { environment: 'development', debug: true, + autoBreadcrumbs: true }) .install(); diff --git a/src/app/papers-list/papers-list.component.ts b/src/app/papers-list/papers-list.component.ts @@ -1,5 +1,6 @@ import {Component} from '@angular/core'; import {ApiService, Paper} from '../api.service'; +import * as Raven from 'raven-js'; @Component({ selector: 'app-papers-list', @@ -10,6 +11,10 @@ export class PapersListComponent { data: (Paper)[][]; constructor(private apiService: ApiService) { + Raven.captureBreadcrumb({ + message: 'Listing Papers', + category: 'papers-list' + }); this.getPapers(); } @@ -17,7 +22,7 @@ export class PapersListComponent { this.apiService.getPapers() .subscribe( data => { this.data = this.chunk(data, 3); }, - err => console.error('API ERR: ', err), + err => Raven.captureException(err), () => console.log('done loading Papers') ); } diff --git a/src/app/tweet-list/tweet-list.component.ts b/src/app/tweet-list/tweet-list.component.ts @@ -1,4 +1,5 @@ import {Component, Input} from '@angular/core'; +import * as Raven from 'raven-js'; import {ApiService, TweetsEntity} from '../api.service'; @@ -12,6 +13,13 @@ export class TweetListComponent { data: (TweetsEntity)[][]; constructor(private apiService: ApiService) { + Raven.captureBreadcrumb({ + message: 'Showing Paper', + category: 'paper', + data: { + uuid: this.uuid + } + }); this.getYesterday(); } @@ -19,7 +27,7 @@ export class TweetListComponent { this.apiService.getYesterday(this.uuid) .subscribe( data => { this.data = this.chunk(data.tweets, 3); }, - err => console.error('API ERR: ', err), + err => Raven.captureException(err), () => console.log('done loading Yesterday') ); }