@travetto/config
Advanced tools
Comparing version 5.0.14 to 5.0.15
{ | ||
"name": "@travetto/config", | ||
"version": "5.0.14", | ||
"version": "5.0.15", | ||
"description": "Configuration support", | ||
@@ -29,4 +29,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@travetto/di": "^5.0.14", | ||
"@travetto/schema": "^5.0.14", | ||
"@travetto/di": "^5.0.15", | ||
"@travetto/schema": "^5.0.15", | ||
"yaml": "^2.6.1" | ||
@@ -33,0 +33,0 @@ }, |
@@ -203,3 +203,3 @@ <!-- This file was generated by @travetto/doc and should not be modified directly --> | ||
{ | ||
message: 'Failed to construct @travetto/config:doc/dbconfig○DBConfig as validation errors have occurred', | ||
message: 'Failed to construct @travetto/config:doc/dbconfig#DBConfig as validation errors have occurred', | ||
category: 'data', | ||
@@ -209,3 +209,3 @@ type: 'ValidationResultError', | ||
details: { | ||
class: '@travetto/config:doc/dbconfig○DBConfig', | ||
class: '@travetto/config:doc/dbconfig#DBConfig', | ||
import: '@travetto/config/doc/dbconfig.ts', | ||
@@ -212,0 +212,0 @@ errors: [ |
@@ -116,4 +116,5 @@ import util from 'node:util'; | ||
async bindTo<T>(cls: Class<T>, item: T, namespace: string, validate = true): Promise<T> { | ||
const classId = cls.Ⲑid; | ||
if (!SchemaRegistry.has(cls)) { | ||
throw new AppError(`${cls.Ⲑid} is not a valid schema class, config is not supported`); | ||
throw new AppError(`${classId} is not a valid schema class, config is not supported`); | ||
} | ||
@@ -127,6 +128,6 @@ const out = BindUtil.bindSchemaToObject(cls, item, this.#get(namespace)); | ||
const ogMessage = err.message; | ||
err.message = `Failed to construct ${cls.Ⲑid} as validation errors have occurred`; | ||
err.message = `Failed to construct ${classId} as validation errors have occurred`; | ||
err.stack = err.stack?.replace(ogMessage, err.message); | ||
const imp = Runtime.getImport(cls); | ||
Object.defineProperty(err, 'details', { value: { class: cls.Ⲑid, import: imp, ...(err.details ?? {}) } }); | ||
Object.defineProperty(err, 'details', { value: { class: classId, import: imp, ...(err.details ?? {}) } }); | ||
} | ||
@@ -133,0 +134,0 @@ throw err; |
28784
413
Updated@travetto/di@^5.0.15
Updated@travetto/schema@^5.0.15