Aller au contenu

Exceptions

tilttek/crafting

Toute exception de la bibliothèque implémente Exception\CraftingException : attrapez celle-ci pour les attraper toutes.

ExceptionLancée quandMessage
InvalidRecipeUn code, une quantité, une recette, un livre, une sélection, une clé, des répétitions ou une limite est hors limitesCe qui est hors limites, et la limite
RecipeNotFoundLe livre ne contient aucune recette de ce codeThe recipe book holds no recipe "…".
CraftRefusedDes objets manquent, une clé a fait une autre fabrication, ou l'inventaire a refuséPourquoi, avec ce qui manque

InvalidRecipe étend InvalidArgumentException, RecipeNotFound étend OutOfBoundsException et CraftRefused étend RuntimeException.

Les messages de InvalidRecipe

ValeurMessage
Un codeThe code of an item must be 1 to 96 lowercase letters, digits, "_", "-" or single dots between them; "…" is not., et de même pour une recette, une étiquette, un attribut et un objet protégé
Une quantitéThe quantity of the ingredient … is 1 to 999; it is …., et de même pour les autres
Une cléThe key of a craft is 1 to 191 visible ASCII characters, without spaces.
Les étiquettes d'un avoirAn item carries at most 16 tags; "…" has ….
Les ingrédientsThe recipe "…" lists 1 to 16 ingredients; it has ….
Un ingrédient nommé deux foisThe recipe "…" names the ingredient … twice.
Des outils seulementThe recipe "…" consumes at least one ingredient; tools alone produce nothing.
Les produits ou les objets rendusThe recipe "…" lists 1 to 8 outputs; it has …., The recipe "…" names "…" twice among its outputs.
La quantité d'un produitThe quantity of "…" in the recipe "…" is 1 to 999; it is ….
Les attributsA recipe carries at most 10 attributes; "…" has …., The attribute "…" is 1 to 100 characters of UTF-8 without control characters nor surrounding spaces.
Une recette qui fait évoluerThe evolving recipe "…" takes its first ingredient, one item named by its code, and consumes it., The evolving recipe "…" produces one item of another kind than "…".
Le livreA recipe book holds at most 1000 recipes; this one has …., The recipe book holds the recipe "…" twice.
Un objet protégéThe recipe "…" consumes "…", which no craft may consume.
Des valeurs simplesA recipe book has no "…"; it knows recipes., et un message qui nomme la valeur et sa forme attendue pour chacune des autres
Une sélectionA selection names the ingredients by their position, 0 to 15; … is not one., A selection chooses 1 to 16 items for an ingredient; … were chosen for the ingredient ….
Un choixA selection chooses items for an ingredient asked by a tag; the ingredient … of the recipe "…" is not one., The items chosen for the ingredient … of the recipe "…" add up to …; it needs …., "…" cannot serve the ingredient … of the recipe "…".
Les recettes les plus prochesThe closest recipes are 1 to 50; … is out of bounds.

Les messages de CraftRefused

CasMessage
Des objets manquentThe recipe "…" cannot be crafted: 1 × #metal, 2 × iron missing.
Une clé qui a fait une autre fabricationThe key "…" already made another craft.
Une clé enregistrée sans sa fabricationThe key "…" is recorded, yet its craft cannot be read.
Trop d'avoirsThe crafter reads at most 10000 holdings of a holder.
Un objet donné deux foisThe inventory gives one holding per item; "…" came twice.
L'inventaire en mémoireThe craft "…" needs … × "…"; the holder has ….

Les exceptions de phil/resource parviennent telles quelles à l'appelant quand une référence est mal formée.