Avoid duplicated paths in FileIOError messages
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
The issue identifies the renderer in Cardano.Api.Error and asks for coverage of both an IOException that includes the path and one without a filename. Read that renderer and its existing tests first, then check how the underlying exception exposes its filename. Done when messages retain the operation and reason, show the path once when present, and keep the wrapper path when absent.
Written by the indexing model from the issue text.
Description
FileIOError messages can repeat the same path because the wrapped IOException already includes it. The current renderer in Cardano.Api.Error prepends the wrapper's path unconditionally:
FileIOError path ioe ->
pretty path <> ": " <> pretty (displayException ioe)
For example, the cardano-cli review reports:
Error: p: p: withBinaryFile: does not exist (No such file or directory)
The path should appear once, while retaining the operation and failure reason. The fix should also preserve the wrapper's path when the underlying exception has no filename. Add coverage for both cases.
This is existing behavior in shared file-error rendering, surfaced again as cardano-cli reuses the API's file IO helpers in cardano-cli PR #1515. Track the rendering fix in a separate cardano-api PR; it does not need to block that CLI change.
Original review comment: https://github.com/IntersectMBO/cardano-cli/pull/1515#discussion_r4773037387
- Dominant language
- Haskell
- Stars
- 41
- Forks
- 33
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntersectMBO/cardano-api
-
`Prelude.maximum: empty list` crash in fee estimation for empty `RequireAnyOf` (`{"type": "any", "scripts": []}`) scriptsPossibly taken @Jimbo4350 claimed this 8 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-api#1424 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 53/100
IntersectMBO/cardano-api#1431 ·
Maintainers usually reply within 2 days
-
type: enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
IntersectMBO/cardano-api#1423 ·
Maintainers usually reply within 2 days
-
Add a dedicated transaction viewing type to the experimental APIPossibly taken @palas claimed this 21 days ago. Opentype: enhancement
IntersectMBO/cardano-api#1416 · 1 assignee ·
Maintainers usually reply within 2 days
-
Dijkstra era type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
IntersectMBO/cardano-api#1386 ·
Maintainers usually reply within 2 days
All issues in IntersectMBO/cardano-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
haskell/bytestring#730 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
seal-harness/seal-harness#399 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
fmidue/codeworld-tasks#124 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
reflex-frp/reflex#563 ·
-
The codecov job never gets a runner on macos-26 and is cancelledPossibly taken @yegor256 claimed this 1 day ago. Openbug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
objectionary/phino#2524 · 1 comment ·
Maintainers usually reply within 1 day