BREAKING CHANGE(package): switch scope to @pushrocks

This commit is contained in:
2018-07-11 15:28:23 +02:00
parent b285ea143e
commit 5d9c19a6e6
14 changed files with 1000 additions and 348 deletions

View File

@ -1,8 +1,33 @@
import * as plugins from './smarterror.plugins'
import * as plugins from './smarterror.plugins';
export class SmartError extends Error {
name = 'SmartError'
constructor (errorMessageArg: string) {
super(errorMessageArg)
import { BaseError, fullStack } from 'make-error-cause';
export const seperatorText = `\n\nThe following exception was the direct cause of the above exception:\n\n`;
export class SmartError extends BaseError {
name = 'SmartError';
constructor(errorMessageArg: string, errorCause?) {
super(errorMessageArg, errorCause);
}
get fullStack() {
return fullStack(this);
}
get cleanFullStack() {
let fullCleanStack = plugins.cleanStack(this.stack);
let errorPointer = this as BaseError;
while (errorPointer.cause) {
fullCleanStack += seperatorText;
if (errorPointer.cause.stack) {
fullCleanStack += plugins.cleanStack(errorPointer.cause.stack);
} else {
fullCleanStack += errorPointer.cause.message;
}
errorPointer = errorPointer.cause as BaseError;
}
return fullCleanStack;
}
}

View File

@ -1,9 +1,3 @@
import 'typings-global'
import * as cleanStack from 'clean-stack';
import * as cleanStack from 'clean-stack'
import * as sourceMapSupport from 'source-map-support'
sourceMapSupport.install()
export {
cleanStack
}
export { cleanStack };