#Supress RecipeComponent errors with a custom schema

14 messages · Page 1 of 1 (latest)

upper bay
#

hi im looking to supress the ugly "Failed to read [...]" errors shown in /kubejs errors server and leave just the fancy and actually readable one i print out myself

console.SERVER.error(`No valid post type! Must be one of ${listPossibleIDs(allPostActions)}`);

(listPossibleIDs lists all possible IDs)
the schema is set up with or'd RecipeComponents because each Post Action can have different parameters
for now this is manageable, but if i were to add, say, 100 components (which is more than there will ever be, but you get the idea), the error list is inflated to 200!! users will Not read all that; i have a hard time they'll read this as-is

yknow perhaps it was a better idea to go for a full blown addon after all

harsh marshBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

river frost
#

not possible

upper bay
#

fuck

river frost
#

afaik try/catch doesn't work

upper bay
#

there isnt really anywhere i could even try catch since that should be where the event is fired.. outside of js

#

mh yeah i cant figure it out

#

perhaps i need a better system than simply chaining several components together then...

#

ill be closing this, ty

upper bay
#

reopening to mention how i solved this, is all

#

in the end, i went with one component that scans an array of handlers, each with their own post action handling, logic and checking

#

this solves the issue of too many errors appearing, as far as i can tell (and through basic logic it should, since there's no longer 100 components all ord together)

#

hi future readers hope you find this helpful, see the scripts above for more info