Validate command input and handle bad values cleanly
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 50/100
Direzione di ricerca
Start by reading the command handlers for /shop add, update, delete, sell, and create, plus identifyStore and the tab completer; the issue does not name their files. Run the existing tests that reproduce the first three rows and the sell case, then add coverage for the remaining rows. Done means invalid input leaves state unchanged, duplicate matches use STORE_MULTI_MATCH in commands and completion, and all listed cases are covered.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Several commands accept input they can't handle, or fail with an unhelpful error.
| Input | Result |
|---|---|
/shop add stone NaN NaN -1 1 (also Infinity, and the same through update) |
Accepted. /shop buy on that item then always fails with "Invalid numerical value" |
/shop add stone -3 with shops.update.inf-stock |
Takes 3 from the store's stock, then reports "Invalid number of arguments" |
/shop update location Dup ... when two stores are named Dup |
MultipleStoresMatchedException isn't caught, so "An internal error occurred". The tab completer calls identifyStore unguarded too |
/shop delete abc~ when a store named abc exists |
split("~") leaves no second part, so input[1] throws |
Store names containing ~ |
Created normally, but can't be found by name afterward |
/shop sell notreal all |
Reports "Invalid quantity (0)" instead of an invalid material |
/shop create <name> <player> |
The limit is checked against the sender's stores, not the new owner's |
The first three rows and the sell row were reproduced in tests. The others come from reading the code.
Done when
- Prices must be finite numbers, and negative values are only accepted where they have a meaning.
- A failed command changes nothing.
- Duplicate-name errors show
STORE_MULTI_MATCHeverywhere, including tab completion. - Store names can't contain
~, or the parser handles them. - Tests cover each row.
- Lingua principale
- Java
- Stelle
- 1
- Fork
- 0
- Merge medio
- 2h 35m
- PR unite (30g)
- 14
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di BrendonButler/Shops
-
dependencies enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
BrendonButler/Shops#79 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BrendonButler/Shops#70 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
BrendonButler/Shops#69 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
BrendonButler/Shops#68 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
BrendonButler/Shops#67 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di BrendonButler/Shops
Issue simili
-
type: dependency-upgrade
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
spring-projects/spring-graphql#1556 ·
-
hermes-queue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
chrisalunlloyd2-sudo/mindpalace#373 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug priority: lowest
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
SkriptLang/Skript#8953 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
quality-assurance
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#228 ·
I maintainer di solito rispondono entro 1 giorno