mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Add sentry error tracking
This commit is contained in:
parent
697779868e
commit
88d8112402
@ -3,6 +3,8 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
- Add Sentry error tracking
|
||||||
|
|
||||||
## [5.6.0] - 2017-03-23
|
## [5.6.0] - 2017-03-23
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
11
build/app.js
11
build/app.js
@ -15,7 +15,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
var Promise, _, actions, capitano, errors, events, plugins, resin, update;
|
var Promise, Raven, _, actions, capitano, errors, events, plugins, resin, update;
|
||||||
|
|
||||||
|
Raven = require('raven');
|
||||||
|
|
||||||
|
Raven.disableConsoleAlerts();
|
||||||
|
|
||||||
|
Raven.config('https://56d2a46124614b01b0f4086897e96110:6e175465accc41b595a96947155f61fb@sentry.io/149239', {
|
||||||
|
captureUnhandledRejections: true,
|
||||||
|
release: require('../package.json').version
|
||||||
|
}).install();
|
||||||
|
|
||||||
_ = require('lodash');
|
_ = require('lodash');
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
var chalk, errors, patterns;
|
var Promise, Raven, captureException, chalk, errors, patterns;
|
||||||
|
|
||||||
chalk = require('chalk');
|
chalk = require('chalk');
|
||||||
|
|
||||||
@ -23,6 +23,12 @@ errors = require('resin-cli-errors');
|
|||||||
|
|
||||||
patterns = require('./utils/patterns');
|
patterns = require('./utils/patterns');
|
||||||
|
|
||||||
|
Raven = require('raven');
|
||||||
|
|
||||||
|
Promise = require('bluebird');
|
||||||
|
|
||||||
|
captureException = Promise.promisify(Raven.captureException.bind(Raven));
|
||||||
|
|
||||||
exports.handle = function(error) {
|
exports.handle = function(error) {
|
||||||
var message;
|
var message;
|
||||||
message = errors.interpret(error);
|
message = errors.interpret(error);
|
||||||
@ -33,5 +39,7 @@ exports.handle = function(error) {
|
|||||||
message = error.stack;
|
message = error.stack;
|
||||||
}
|
}
|
||||||
patterns.printErrorMessage(message);
|
patterns.printErrorMessage(message);
|
||||||
return process.exit(error.exitCode || 1);
|
return captureException(error).timeout(1000)["catch"](function() {})["finally"](function() {
|
||||||
|
return process.exit(error.exitCode || 1);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
@ -14,6 +14,14 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
###
|
###
|
||||||
|
|
||||||
|
Raven = require('raven')
|
||||||
|
Raven.disableConsoleAlerts()
|
||||||
|
Raven.config(
|
||||||
|
'https://56d2a46124614b01b0f4086897e96110:6e175465accc41b595a96947155f61fb@sentry.io/149239'
|
||||||
|
captureUnhandledRejections: true
|
||||||
|
release: require('../package.json').version
|
||||||
|
).install()
|
||||||
|
|
||||||
_ = require('lodash')
|
_ = require('lodash')
|
||||||
Promise = require('bluebird')
|
Promise = require('bluebird')
|
||||||
capitano = Promise.promisifyAll(require('capitano'))
|
capitano = Promise.promisifyAll(require('capitano'))
|
||||||
|
@ -17,6 +17,10 @@ limitations under the License.
|
|||||||
chalk = require('chalk')
|
chalk = require('chalk')
|
||||||
errors = require('resin-cli-errors')
|
errors = require('resin-cli-errors')
|
||||||
patterns = require('./utils/patterns')
|
patterns = require('./utils/patterns')
|
||||||
|
Raven = require('raven')
|
||||||
|
Promise = require('bluebird')
|
||||||
|
|
||||||
|
captureException = Promise.promisify(Raven.captureException.bind(Raven))
|
||||||
|
|
||||||
exports.handle = (error) ->
|
exports.handle = (error) ->
|
||||||
message = errors.interpret(error)
|
message = errors.interpret(error)
|
||||||
@ -26,4 +30,9 @@ exports.handle = (error) ->
|
|||||||
message = error.stack
|
message = error.stack
|
||||||
|
|
||||||
patterns.printErrorMessage(message)
|
patterns.printErrorMessage(message)
|
||||||
process.exit(error.exitCode or 1)
|
|
||||||
|
captureException(error)
|
||||||
|
.timeout(1000)
|
||||||
|
.catch(-> # Ignore any errors (from error logging, or timeouts)
|
||||||
|
).finally ->
|
||||||
|
process.exit(error.exitCode or 1)
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
"president": "^2.0.1",
|
"president": "^2.0.1",
|
||||||
"prettyjson": "^1.1.3",
|
"prettyjson": "^1.1.3",
|
||||||
"reconfix": "^0.0.3",
|
"reconfix": "^0.0.3",
|
||||||
|
"raven": "^1.2.0",
|
||||||
"resin-cli-auth": "^1.0.0",
|
"resin-cli-auth": "^1.0.0",
|
||||||
"resin-cli-errors": "^1.2.0",
|
"resin-cli-errors": "^1.2.0",
|
||||||
"resin-cli-form": "^1.4.1",
|
"resin-cli-form": "^1.4.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user