Merged PR 1947: #5331 Set correct Prototype

#5331 Set correct Prototype
This commit is contained in:
Nino Righi
2025-09-11 15:42:54 +00:00
committed by Lorenz Hilpert
parent 2c70339f23
commit fd693a4beb

View File

@@ -44,5 +44,8 @@ export class DataAccessError<TCode extends string, TData = void> extends Error {
public readonly data: TData,
) {
super(message);
// Set the prototype explicitly to maintain the correct prototype chain
Object.setPrototypeOf(this, new.target.prototype);
this.name = this.constructor.name;
}
}