Do it. Or do not. There is no attempt. =)
Client-side AngularJS library for Stackdriver Error Reporting
"Fear is the way to the dark side. Fear leads to anger, anger leads to hatred, hatred leads to suffering."
-- Yoda
Dependencies
Download make the dependencies of simpleGridMaterial and include in your project
- https://angularjs.org/
- https://material.angularjs.org/latest/
- https://github.com/miamarti/stackdriver-errors-js
Installation
$ npm install ng-stackdriver-errors --save
Module AngularJS include
require('angular');
angular.module('Requisition', [
require('angular-animate'),
require('angular-material'),
require('ng-stackdriver-errors') //Component Injection
])
Implementation
Inside config:
angular.module('example').config(function($exceptionHandlerStdProvider) {
$exceptionHandlerStdProvider.config({
key: '<my-api-key>',
projectId: '<my-project-id>',
service: '<my-service>', // (optional)
version: '<my-service-version>' // (optional)
});
$exceptionHandlerStdProvider.setUser('XUXA-010203');
});
Inside the Controller:
angular.module('example').controller('ExampleController', function ($exceptionHandlerStd) {
try {
...
} catch(e) {
$exceptionHandlerStd.throw(e);
}
});
Parameters
Name | Type | provider | Controller | Description |
---|---|---|---|---|
config | Method | true | false | sets the stackdriver-errors configuration data |
setUser | Method | true | true | sets the user to be logged on to stackdriver-errors |
throw | Method | true | true | throws an exception |
Development
Edit version.js
and run the command below:
$ npm run build