Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Fix liftToIntegration exception handling and rename

Aperta
#6,567 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@palas ci sta già lavorando.

Dal 8/5/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Problem

liftToIntegration in cardano-testnet/src/Testnet/Start/Cardano.hs:104 has two issues:

1. Duplicate exception messages

The current exception handler chain:

catch @_ @SomeException (runRIO rMap r) (withFrozenCallStack $ failException . toException . stringException . displayException)

serializes the exception to a string via displayException, then wraps it in a new StringException (which captures its own callstack), then passes that to failException (which calls displayException again). This produces output like:

━━━ Exception (StringException) ━━━
UnliftIO.Exception.throwString called with:

! AnnotatedException !
Underlying exception type: StringException

UnliftIO.Exception.throwString called with:

<actual error message>
Called from: ...

CallStack (from HasCallStack): ...
Called from: ...

The error message and callstack appear twice, and the exception type banners are nested three levels deep.

Fix: replace the chain with just failException, which already accepts SomeException:

catch @_ @SomeException (runRIO rMap r) (withFrozenCallStack failException)
2. Unclear name

liftToIntegration doesn't convey what is being lifted from/to. A name like runRIOInIntegration would be clearer — it runs a RIO ResourceMap action inside Hedgehog's Integration monad.

Context

Originally flagged as tech debt from https://github.com/IntersectMBO/cardano-node/pull/6346 (unresolved comments by @carbolymer), revisited in https://github.com/IntersectMBO/cardano-node/pull/6559#discussion_r3200025726.

Lingua principale
Haskell
Stelle
3.2k
Fork
760
Merge medio
2g 9h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/cardano-node

Tutte le issue di IntersectMBO/cardano-node

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.