From d052871fe0981e5b73f6ba12c166453da9d99202 Mon Sep 17 00:00:00 2001 From: dswbx Date: Fri, 19 Sep 2025 20:05:53 +0200 Subject: [PATCH] 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. --- app/build.cli.ts | 2 +- app/src/core/utils/schema/index.ts | 3 ++- app/src/media/storage/Storage.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/build.cli.ts b/app/build.cli.ts index 098ef97..1d36d69 100644 --- a/app/build.cli.ts +++ b/app/build.cli.ts @@ -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({ diff --git a/app/src/core/utils/schema/index.ts b/app/src/core/utils/schema/index.ts index 5f10092..1b5d20f 100644 --- a/app/src/core/utils/schema/index.ts +++ b/app/src/core/utils/schema/index.ts @@ -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)}`, ); } diff --git a/app/src/media/storage/Storage.ts b/app/src/media/storage/Storage.ts index 893e25f..6615f8e 100644 --- a/app/src/media/storage/Storage.ts +++ b/app/src/media/storage/Storage.ts @@ -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); } }