Socket
Socket
Sign inDemoInstall

@jamashita/anden-error

Package Overview
Dependencies
2
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.11.0 to 2.12.0

2

dist/cjs/Errors.d.ts

@@ -7,4 +7,4 @@ import { RuntimeError } from './RuntimeError';

getErrors(): Array<E>;
getStack(): string;
get stack(): string;
}
//# sourceMappingURL=Errors.d.ts.map

@@ -20,7 +20,4 @@ "use strict";

}
getStack() {
get stack() {
return this.errors.map((error) => {
if (error instanceof RuntimeError_1.RuntimeError) {
return error.getStack();
}
return error.stack;

@@ -27,0 +24,0 @@ }).filter((stack) => {

@@ -1,6 +0,5 @@

import { Ambiguous } from '@jamashita/anden-type';
import { RuntimeError } from '../RuntimeError';
export declare class MockRuntimeError extends RuntimeError {
constructor(cause?: Ambiguous<Error>);
constructor(cause?: Error);
}
//# sourceMappingURL=MockRuntimeError.d.ts.map

@@ -1,8 +0,9 @@

import { Ambiguous } from '@jamashita/anden-type/src/index';
import { BaseError } from 'make-error-cause';
export declare abstract class RuntimeError extends BaseError {
protected constructor(message: string, cause?: Ambiguous<Error>);
getStack(): string;
export declare abstract class RuntimeError extends Error {
private readonly cause;
protected constructor(message: string, cause?: Error);
private stackErrors;
toString(): string;
get name(): string;
get stack(): string;
}
//# sourceMappingURL=RuntimeError.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RuntimeError = void 0;
const make_error_cause_1 = require("make-error-cause");
class RuntimeError extends make_error_cause_1.BaseError {
const anden_type_1 = require("@jamashita/anden-type");
const SEPARATOR_TEXT = '\n\nThe following exception was the direct cause of the above exception:\n\n';
class RuntimeError extends Error {
constructor(message, cause) {
super(message, cause);
super(message);
this.cause = cause;
}
getStack() {
return (0, make_error_cause_1.fullStack)(this);
stackErrors(error, chain) {
chain.push(error);
if (error instanceof RuntimeError) {
if (!anden_type_1.Kind.isUndefined(error.cause)) {
this.stackErrors(error.cause, chain);
}
}
}
toString() {
return this.getStack();
return this.stack;
}
get name() {
return this.constructor.name;
}
get stack() {
const chain = [];
this.stackErrors(this, chain);
return chain.map((err) => {
return err.message;
}).join(SEPARATOR_TEXT);
}
}
exports.RuntimeError = RuntimeError;
//# sourceMappingURL=RuntimeError.js.map

@@ -1,6 +0,5 @@

import { Ambiguous } from '@jamashita/anden-type';
import { RuntimeError } from './RuntimeError';
export declare class UnimplementedError extends RuntimeError {
constructor(message?: string, cause?: Ambiguous<Error>);
constructor(message?: string, cause?: Error);
}
//# sourceMappingURL=UnimplementedError.d.ts.map

@@ -7,4 +7,4 @@ import { RuntimeError } from './RuntimeError';

getErrors(): Array<E>;
getStack(): string;
get stack(): string;
}
//# sourceMappingURL=Errors.d.ts.map

@@ -17,7 +17,4 @@ import { Kind } from '@jamashita/anden-type';

}
getStack() {
get stack() {
return this.errors.map((error) => {
if (error instanceof RuntimeError) {
return error.getStack();
}
return error.stack;

@@ -24,0 +21,0 @@ }).filter((stack) => {

@@ -1,6 +0,5 @@

import { Ambiguous } from '@jamashita/anden-type';
import { RuntimeError } from '../RuntimeError';
export declare class MockRuntimeError extends RuntimeError {
constructor(cause?: Ambiguous<Error>);
constructor(cause?: Error);
}
//# sourceMappingURL=MockRuntimeError.d.ts.map

@@ -1,8 +0,9 @@

import { Ambiguous } from '@jamashita/anden-type/src/index';
import { BaseError } from 'make-error-cause';
export declare abstract class RuntimeError extends BaseError {
protected constructor(message: string, cause?: Ambiguous<Error>);
getStack(): string;
export declare abstract class RuntimeError extends Error {
private readonly cause;
protected constructor(message: string, cause?: Error);
private stackErrors;
toString(): string;
get name(): string;
get stack(): string;
}
//# sourceMappingURL=RuntimeError.d.ts.map

@@ -1,13 +0,30 @@

import { BaseError, fullStack } from 'make-error-cause';
export class RuntimeError extends BaseError {
import { Kind } from '@jamashita/anden-type';
const SEPARATOR_TEXT = '\n\nThe following exception was the direct cause of the above exception:\n\n';
export class RuntimeError extends Error {
constructor(message, cause) {
super(message, cause);
super(message);
this.cause = cause;
}
getStack() {
return fullStack(this);
stackErrors(error, chain) {
chain.push(error);
if (error instanceof RuntimeError) {
if (!Kind.isUndefined(error.cause)) {
this.stackErrors(error.cause, chain);
}
}
}
toString() {
return this.getStack();
return this.stack;
}
get name() {
return this.constructor.name;
}
get stack() {
const chain = [];
this.stackErrors(this, chain);
return chain.map((err) => {
return err.message;
}).join(SEPARATOR_TEXT);
}
}
//# sourceMappingURL=RuntimeError.js.map

@@ -1,6 +0,5 @@

import { Ambiguous } from '@jamashita/anden-type';
import { RuntimeError } from './RuntimeError';
export declare class UnimplementedError extends RuntimeError {
constructor(message?: string, cause?: Ambiguous<Error>);
constructor(message?: string, cause?: Error);
}
//# sourceMappingURL=UnimplementedError.d.ts.map
{
"name": "@jamashita/anden-error",
"version": "2.11.0",
"version": "2.12.0",
"private": false,

@@ -28,4 +28,3 @@ "repository": {

"dependencies": {
"@jamashita/anden-type": "^2.8.0",
"make-error-cause": "2.3.0"
"@jamashita/anden-type": "^2.8.0"
},

@@ -32,0 +31,0 @@ "engines": {

@@ -24,8 +24,4 @@ import { Ambiguous, Kind } from '@jamashita/anden-type';

public override getStack(): string {
public override get stack(): string {
return this.errors.map((error: E): Ambiguous<string> => {
if (error instanceof RuntimeError) {
return error.getStack();
}
return error.stack;

@@ -32,0 +28,0 @@ }).filter((stack: Ambiguous<string>): stack is string => {

@@ -1,8 +0,7 @@

import { Ambiguous } from '@jamashita/anden-type';
import { RuntimeError } from '../RuntimeError';
export class MockRuntimeError extends RuntimeError {
public constructor(cause?: Ambiguous<Error>) {
public constructor(cause?: Error) {
super('failed', cause);
}
}

@@ -1,16 +0,40 @@

import { Ambiguous } from '@jamashita/anden-type/src/index';
import { BaseError, fullStack } from 'make-error-cause';
import { Ambiguous, Kind } from '@jamashita/anden-type';
export abstract class RuntimeError extends BaseError {
protected constructor(message: string, cause?: Ambiguous<Error>) {
super(message, cause);
const SEPARATOR_TEXT: string = '\n\nThe following exception was the direct cause of the above exception:\n\n';
export abstract class RuntimeError extends Error {
private readonly cause: Ambiguous<Error>;
protected constructor(message: string, cause?: Error) {
super(message);
this.cause = cause;
}
public getStack(): string {
return fullStack(this);
private stackErrors(error: Error, chain: Array<Error>): void {
chain.push(error);
if (error instanceof RuntimeError) {
if (!Kind.isUndefined(error.cause)) {
this.stackErrors(error.cause, chain);
}
}
}
public override toString(): string {
return this.getStack();
return this.stack;
}
public override get name(): string {
return this.constructor.name;
}
public override get stack(): string {
const chain: Array<Error> = [];
this.stackErrors(this, chain);
return chain.map((err: Error): string => {
return err.message;
}).join(SEPARATOR_TEXT);
}
}

@@ -1,8 +0,7 @@

import { Ambiguous } from '@jamashita/anden-type';
import { RuntimeError } from './RuntimeError';
export class UnimplementedError extends RuntimeError {
public constructor(message: string = 'UNIMPLEMENTED', cause?: Ambiguous<Error>) {
public constructor(message: string = 'UNIMPLEMENTED', cause?: Error) {
super(message, cause);
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc