mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-15 18:45:03 +00:00
feat: prettier errors
This commit is contained in:
parent
84c1d7f82d
commit
9741bffec5
2 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
import { BaseConfig, ConfigValidationError, GuildPluginBlueprint, PluginConfigManager } from "knub";
|
||||
import { ZodError } from "zod/v4";
|
||||
import { z, ZodError } from "zod/v4";
|
||||
import { availableGuildPlugins } from "./plugins/availablePlugins.js";
|
||||
import { zZeppelinGuildConfig } from "./types.js";
|
||||
import { formatZodIssue } from "./utils/formatZodIssue.js";
|
||||
|
@ -42,7 +42,7 @@ export async function validateGuildConfig(config: any): Promise<string | null> {
|
|||
await configManager.init();
|
||||
} catch (err) {
|
||||
if (err instanceof ZodError) {
|
||||
return `${pluginName}: ${err.issues.map(formatZodIssue).join("\n")}`;
|
||||
return `${pluginName}:\n${z.prettifyError(err)}`;
|
||||
}
|
||||
if (err instanceof ConfigValidationError) {
|
||||
return `${pluginName}: ${err.message}`;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div v-else>
|
||||
<div v-if="errors.length" class="bg-gray-800 py-2 px-3 rounded shadow-md mb-4">
|
||||
<div class="font-semibold">Errors:</div>
|
||||
<div v-for="error in errors">{{ error }}</div>
|
||||
<pre v-for="error in errors">{{ error }}</pre>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center flex-wrap">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue