@sd-jwt/utils
Version:
sd-jwt draft 7 implementation in typescript
17 lines (14 loc) • 421 B
text/typescript
export class SDJWTException extends Error {
public details?: unknown;
constructor(message: string, details?: unknown) {
super(message);
Object.setPrototypeOf(this, SDJWTException.prototype);
this.name = 'SDJWTException';
this.details = details;
}
getFullMessage(): string {
return `${this.name}: ${this.message} ${
this.details ? `- ${JSON.stringify(this.details)}` : ''
}`;
}
}