Fix entity referencing issue during post-seeded relational fetch

This commit is contained in:
dswbx
2025-01-10 17:28:43 +01:00
parent e94e8d8bd1
commit bb756548a6
11 changed files with 95 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
export class Exception extends Error {
code = 400;
override name = "Exception";
protected _context = undefined;
constructor(message: string, code?: number) {
super(message);
@@ -9,11 +10,16 @@ export class Exception extends Error {
}
}
context(context: any) {
this._context = context;
return this;
}
toJSON() {
return {
error: this.message,
type: this.name
//message: this.message
type: this.name,
context: this._context
};
}
}