Skip to content

Instantly share code, notes, and snippets.

@mukgupta
mukgupta / RavenSetup.js
Last active August 29, 2015 14:01
Raven Setup
<script src="//cdn.ravenjs.com/1.1.15/jquery,native/raven.min.js"></script>
<script type="text/javascript">
var options = {
logger: 'my-logger',
ignoreUrls: [
// Facebook flakiness
/graph\.facebook\.com/i,
// Facebook blocked
/connect\.facebook\.net\/en_US\/all\.js/i,
// Woopra flakiness
@mukgupta
mukgupta / angular-raven.js
Created May 21, 2014 15:11
Angular Raven plugin
/* jshint -W040 */
(function(module, angular, undefined) {
'use strict';
module.provider('Raven', function() {
var _development = null;
this.development = function(config) {
_development = config || _development;
return this;
@mukgupta
mukgupta / angular.js
Created May 21, 2014 15:13
Raven-js Angularjs plugin
/**
* Angular.js plugin
*
* Provides an $exceptionHandler for Angular.js
*/
;(function(Raven, angular) {
'use strict';
// quit if angular isn't on the page
if (!angular) {
@mukgupta
mukgupta / ravenuser.js
Created May 21, 2014 15:21
Raven-js Associate User
Raven.setUser({
"id": 'UNIQUE_USER_ID',
"email": 'USER_EMAIL'
})
@mukgupta
mukgupta / djangoraven.py
Created May 21, 2014 15:29
Django Raven Settings
# Set your DSN value
RAVEN_CONFIG = {
'dsn': 'YOUR_DSN_KEY',
}
# Add raven to the list of installed apps
INSTALLED_APPS = INSTALLED_APPS + (
# ...
'raven.contrib.django.raven_compat',
)
@mukgupta
mukgupta / CeleryLogger.py
Created May 21, 2014 15:46
Raven Celery Logging
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
@mukgupta
mukgupta / RavenCeleryInstalledApp.py
Created May 21, 2014 15:48
Raven Celery Package
# Add raven to the list of installed apps
INSTALLED_APPS = INSTALLED_APPS + (
# ...
'raven.contrib.django.celery ',
)
@mukgupta
mukgupta / RavenJSCapture.js
Created May 21, 2014 16:47
Raven Capture Error
// record a simple message
Raven.captureMessage('hello world!')
// capture an exception
try {
errorThrowingCode();
} catch(err) {
Raven.captureException(err);
}
@mukgupta
mukgupta / RavenAngularHTTPInterceptor.js
Created May 22, 2014 09:03
AngularJs log HTTP Errors using Sentry
myApp.factory('RavenHTTPInterceptor', ['Raven', '$q', function(Raven, $q) {
var httpIgnoreErrors = [401]; //Error codes to be ignored
var ignoreError = function(error){
return httpIgnoreErrors.indexOf(error) !== -1;
}
return {
// optional method
@mukgupta
mukgupta / keybase.md
Created February 9, 2017 07:56
keybase.md

Keybase proof

I hereby claim:

  • I am mukgupta on github.
  • I am mukgupta (https://keybase.io/mukgupta) on keybase.
  • I have a public key ASBRcXF8DPS18tWTyrE_2aATHKLzzDVQ-RDdfgYyrBFQ2go

To claim this, I am signing this object: