kibana-123
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
28 lines (23 loc) • 580 B
JavaScript
import _ from 'lodash';
let errors = {};
let canStack = (function () {
let err = new Error();
return !!err.stack;
}());
// abstract error class
_.class(KibanaError).inherits(Error);
function KibanaError(msg, constructor) {
this.message = msg;
Error.call(this, this.message);
if (!this.stack) {
if (Error.captureStackTrace) {
Error.captureStackTrace(this, constructor || KibanaError);
} else if (canStack) {
this.stack = (new Error()).stack;
} else {
this.stack = '';
}
}
}
errors.KibanaError = KibanaError;
export default errors;