Files
dealplustech/node_modules/astro/dist/content/loaders/errors.js
Kunthawat Greethong 6562a1748f fix: Fix product page syntax errors
1. Remove duplicate/broken code in product tables section
2. Fix PostCSS config for Tailwind 4
3. Add @tailwindcss/postcss dependency
4. Remove --production flag from Dockerfile (sharp required)

All fixes enable successful Docker build with favicon working.
2026-03-03 14:57:46 +07:00

68 lines
1.9 KiB
JavaScript

class LiveCollectionError extends Error {
constructor(collection, message, cause) {
super(message);
this.collection = collection;
this.message = message;
this.cause = cause;
this.name = "LiveCollectionError";
if (cause?.stack) {
this.stack = cause.stack;
}
}
static is(error) {
return error instanceof LiveCollectionError;
}
}
class LiveEntryNotFoundError extends LiveCollectionError {
constructor(collection, entryFilter) {
super(
collection,
`Entry ${collection} \u2192 ${typeof entryFilter === "string" ? entryFilter : JSON.stringify(entryFilter)} was not found.`
);
this.name = "LiveEntryNotFoundError";
}
static is(error) {
return error?.name === "LiveEntryNotFoundError";
}
}
class LiveCollectionValidationError extends LiveCollectionError {
constructor(collection, entryId, error) {
super(
collection,
[
`**${collection} \u2192 ${entryId}** data does not match the collection schema.
`,
...error.errors.map((zodError) => ` **${zodError.path.join(".")}**: ${zodError.message}`),
""
].join("\n")
);
this.name = "LiveCollectionValidationError";
}
static is(error) {
return error?.name === "LiveCollectionValidationError";
}
}
class LiveCollectionCacheHintError extends LiveCollectionError {
constructor(collection, entryId, error) {
super(
collection,
[
`**${String(collection)}${entryId ? ` \u2192 ${String(entryId)}` : ""}** returned an invalid cache hint.
`,
...error.errors.map((zodError) => ` **${zodError.path.join(".")}**: ${zodError.message}`),
""
].join("\n")
);
this.name = "LiveCollectionCacheHintError";
}
static is(error) {
return error?.name === "LiveCollectionCacheHintError";
}
}
export {
LiveCollectionCacheHintError,
LiveCollectionError,
LiveCollectionValidationError,
LiveEntryNotFoundError
};