fix: update external dependencies and enhance error logging

Added "wrangler" to the external dependencies in the build configuration. Improved error logging in the Storage class to include the file name when image dimension retrieval fails. Enhanced the InvalidSchemaError to provide additional context by including the schema in the error message.
This commit is contained in:
dswbx
2025-09-19 20:05:53 +02:00
parent b0e5a49b0b
commit d052871fe0
3 changed files with 4 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import { formatNumber } from "bknd/utils";
import * as esbuild from "esbuild";
const deps = Object.keys(pkg.dependencies);
const external = ["jsonv-ts/*", ...deps];
const external = ["jsonv-ts/*", "wrangler", ...deps];
if (process.env.DEBUG) {
const result = await esbuild.build({

View File

@@ -38,7 +38,8 @@ export class InvalidSchemaError extends Error {
) {
super(
`Invalid schema given for ${JSON.stringify(value, null, 2)}\n\n` +
`Error: ${JSON.stringify(errors[0], null, 2)}`,
`Error: ${JSON.stringify(errors[0], null, 2)}\n\n` +
`Schema: ${JSON.stringify(schema.toJSON(), null, 2)}`,
);
}

View File

@@ -103,7 +103,7 @@ export class Storage implements EmitsEvents {
...dim,
};
} catch (e) {
$console.warn("Failed to get image dimensions", e);
$console.warn("Failed to get image dimensions", e, file);
}
}