Throw typed errors with a `cause`
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, node.js, typescript
Direzione di ricerca
Start by reading the listed wait-strategy, generic-container, bound-ports, and docker-compose-environment files, then trace the 33 new Error(...) sites and existing tests. Define exported error categories with useful fields and preserve existing messages while attaching underlying errors as cause. Done when the main listed failure types are distinguishable by class, retain causes where errors are wrapped, and tests cover the new fields and unchanged messages.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
Every error created by packages/testcontainers is a plain Error. There are 33 new Error(...) sites and no error subclasses. A caller can only tell failures apart by matching message text:
Log message "..." not received after 60000msURL /health not accessible after 60000msImage "..." does not exist locally and pull policy is "never"No port binding found for :8080/tcpCannot get container "..." as it is not runningFailed to build image
None of them carry a cause, so the underlying Docker or network error is lost when one is wrapped.
Expected
Exported error classes for the main failure categories, with useful fields, so callers and test helpers can branch on them:
- startup timeout (strategy, timeout, container id)
- container exited during startup (exit code)
- image pull or build failure
- missing port binding or unknown container
Underlying errors are attached as cause.
Where
packages/testcontainers/src/wait-strategies/*.tspackages/testcontainers/src/generic-container/*.tspackages/testcontainers/src/utils/bound-ports.tspackages/testcontainers/src/docker-compose-environment/*.ts
Notes
- Java has
ContainerLaunchExceptionandContainerFetchException. - Related: #1506 (container logs in the start error), #1507 (fail the HTTP wait when the container exits), #1508 (build output on a failed build). Typed errors give those a place to put the logs and exit code.
- Keeping the existing messages makes this additive.
Dependencies
- Nothing blocks this. It can start now.
- Lingua principale
- TypeScript
- Stelle
- 2.7k
- Fork
- 290
- Merge medio
- 4g 1h
- PR unite (30g)
- 22
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un 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 testcontainers/testcontainers-node
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
testcontainers/testcontainers-node#1673 ·
I maintainer di solito rispondono entro 4 giorni
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
testcontainers/testcontainers-node#1539 ·
I maintainer di solito rispondono entro 4 giorni
-
Let `Wait.forListeningPorts()` wait on specific portsForse già presa @artbom l’ha presa 29 giorni fa. Apertaenhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
testcontainers/testcontainers-node#1533 ·
I maintainer di solito rispondono entro 4 giorni
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
testcontainers/testcontainers-node#1531 ·
I maintainer di solito rispondono entro 4 giorni
-
Export the types used in public method signaturesForse già presa @artbom l’ha presa 29 giorni fa. Apertaenhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
testcontainers/testcontainers-node#1528 ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di testcontainers/testcontainers-node
Issue simili
-
prio:low scope:hud
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OliverRomhagen/vrigstad-joyride#953 ·
I maintainer di solito rispondono entro 1 giorno
-
review-followup
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
griffinwork40/agent-afk#5446 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
kacper-szewczyk/Ticknest#346 ·
I maintainer di solito rispondono entro 1 giorno
-
echarts geo: a GeoJSON URL that returns 200 with a body that is not JSON is fetched on each refreshApertabug plugin/echarts/geo
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
Yeachan-Heo/gajae-code#8230 ·
I maintainer di solito rispondono entro 1 giorno