Retain edit-open failure details #649

Merged
barrettruth merged 1 commit from fix/637-edit-open-failure-detail into main 2026-05-06 21:26:59 +00:00
Owner

Closes #637

Summary

  • Split edit-open detail loading errors into fetch, JSON decode, and backend parser phases.
  • Preserve bounded decode/parser detail through the shared formatter.
  • Strip Lua file/line prefixes from parser exceptions before showing the message.
  • Cover PR fetch failures, PR invalid JSON, PR parser exceptions, and issue invalid JSON.

Messaging

Before After
failed to parse PR details for invalid JSON failed to decode PR details: Expected object key string but found T_END at character 2
failed to parse PR details for parser exception failed to parse PR details: null assignees
failed to parse issue details for invalid JSON failed to decode issue details: Expected object key string but found T_END at character 2
failed to fetch PR #42 for CLI failure with stderr failed to fetch PR #42: authentication failed

Verification

  • Before repro: system nvim v0.12.2, isolated XDG dirs, vim.pack, and lz.n against da6bfa7 reproduced invalid JSON and parser exception both as failed to parse PR details.
  • After repro: same system nvim/vim.pack/lz.n flow against 37674c0 produced failed to decode PR details: Expected object key string but found T_END at character 2 and failed to parse PR details: null assignees.
  • just test spec/ops_spec.lua
  • just test
  • just lint
  • nix develop .#ci --command just ci
Closes #637 ## Summary - Split edit-open detail loading errors into fetch, JSON decode, and backend parser phases. - Preserve bounded decode/parser detail through the shared formatter. - Strip Lua file/line prefixes from parser exceptions before showing the message. - Cover PR fetch failures, PR invalid JSON, PR parser exceptions, and issue invalid JSON. ## Messaging | Before | After | | --- | --- | | `failed to parse PR details` for invalid JSON | `failed to decode PR details: Expected object key string but found T_END at character 2` | | `failed to parse PR details` for parser exception | `failed to parse PR details: null assignees` | | `failed to parse issue details` for invalid JSON | `failed to decode issue details: Expected object key string but found T_END at character 2` | | `failed to fetch PR #42` for CLI failure with stderr | `failed to fetch PR #42: authentication failed` | ## Verification - Before repro: system `nvim` v0.12.2, isolated XDG dirs, `vim.pack`, and `lz.n` against `da6bfa7` reproduced invalid JSON and parser exception both as `failed to parse PR details`. - After repro: same system `nvim`/`vim.pack`/`lz.n` flow against `37674c0` produced `failed to decode PR details: Expected object key string but found T_END at character 2` and `failed to parse PR details: null assignees`. - `just test spec/ops_spec.lua` - `just test` - `just lint` - `nix develop .#ci --command just ci`
Retain edit detail failures
All checks were successful
quality / Test (pull_request) Successful in 12s
quality / Format (pull_request) Successful in 17s
quality / Lint (pull_request) Successful in 18s
37674c0112
barrettruth deleted branch fix/637-edit-open-failure-detail 2026-05-06 21:26:59 +00:00
Sign in to join this conversation.
No description provided.