mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
fix: better error messages for publish
This commit is contained in:
@@ -196,7 +196,10 @@ if (res.ok) {
|
|||||||
console.error("Status Text ", res.statusText);
|
console.error("Status Text ", res.statusText);
|
||||||
switch(res.status) {
|
switch(res.status) {
|
||||||
case 400 : {
|
case 400 : {
|
||||||
console.error('errors:', inspect(await res.json(), { depth: Infinity }));
|
const validation_errors = await res.json()
|
||||||
|
console.error('errors:', inspect(validation_errors, { depth: Infinity }));
|
||||||
|
console.error("Modules with validation errors:"
|
||||||
|
+ inspect(Object.keys(validation_errors.errors).map(idx => globalCommands[idx as any])))
|
||||||
throw Error("400: Ensure your commands have proper fields and data with nothing left out");
|
throw Error("400: Ensure your commands have proper fields and data with nothing left out");
|
||||||
}
|
}
|
||||||
case 404 : {
|
case 404 : {
|
||||||
@@ -252,6 +255,9 @@ for (const [guildId, array] of guildCommandMap.entries()) {
|
|||||||
switch(response.status) {
|
switch(response.status) {
|
||||||
case 400 : {
|
case 400 : {
|
||||||
console.error(inspect(result, { depth: Infinity }))
|
console.error(inspect(result, { depth: Infinity }))
|
||||||
|
console.error("Modules with validation errors:"
|
||||||
|
+ inspect(Object.keys(result.errors).map(idx => array[idx as any])))
|
||||||
|
|
||||||
throw Error("400: Ensure your commands have proper fields and data and nothing left out");
|
throw Error("400: Ensure your commands have proper fields and data and nothing left out");
|
||||||
}
|
}
|
||||||
case 404 : {
|
case 404 : {
|
||||||
|
|||||||
Reference in New Issue
Block a user