adapter tests
Some checks failed
CI / lint-typecheck (push) Failing after 4m54s
CI / tests (push) Has been skipped
CI / contract-tests (push) Has been skipped
CI / e2e-tests (push) Has been skipped
CI / comment-pr (push) Has been skipped
CI / commit-types (push) Has been skipped

This commit is contained in:
2026-01-25 12:02:28 +01:00
parent 9f219c0181
commit 77ab2bf2ff
2 changed files with 9 additions and 2 deletions

View File

@@ -7,7 +7,14 @@ export class TypeOrmAdminSchemaError extends Error {
message: string; message: string;
}, },
) { ) {
super(`[TypeOrmAdminSchemaError] ${details.entityName}.${details.fieldName}: ${details.reason} - ${details.message}`); super('');
this.name = 'TypeOrmAdminSchemaError'; this.name = 'TypeOrmAdminSchemaError';
// Override the message property to be dynamic
Object.defineProperty(this, 'message', {
get: () => `[TypeOrmAdminSchemaError] ${this.details.entityName}.${this.details.fieldName}: ${this.details.reason} - ${this.details.message}`,
enumerable: true,
configurable: true,
});
} }
} }

View File

@@ -44,7 +44,7 @@ export function assertOptionalString(entityName: string, fieldName: string, valu
if (value === null || value === undefined) { if (value === null || value === undefined) {
return; return;
} }
if (typeof value !== 'string') { if (typeof value !== 'string' || value.trim().length === 0) {
throw new TypeOrmAdminSchemaError({ throw new TypeOrmAdminSchemaError({
entityName, entityName,
fieldName, fieldName,