Skip to content

Make hiffy_decode return a non-nested error#661

Open
mkeeter wants to merge 1 commit into
mkeeter/loading-idol-resultfrom
mkeeter/hiffy-decode-flat
Open

Make hiffy_decode return a non-nested error#661
mkeeter wants to merge 1 commit into
mkeeter/loading-idol-resultfrom
mkeeter/hiffy-decode-flat

Conversation

@mkeeter
Copy link
Copy Markdown
Contributor

@mkeeter mkeeter commented May 12, 2026

(staged on #660)

hiffy_decode returns a Result<std::result::Result<T, String>>, which is an awkward type.

We can instead use the HiffyCallError (renamed HiffyError), which distinguishes between internal errors (returned by the HIF program) and external errors (which occur when calling hiffy).

This simplifies most cases (where we want to return both inner and outer error), and adds a tiny bit of boilerplate to cases where we care about the difference – but that boilerplate is more clear than the nested type.

@mkeeter mkeeter requested a review from labbott May 12, 2026 21:46
@mkeeter mkeeter force-pushed the mkeeter/loading-idol-result branch from e0a515b to 2dea381 Compare May 13, 2026 21:41
@mkeeter mkeeter force-pushed the mkeeter/hiffy-decode-flat branch from 70f547e to 02dc755 Compare May 13, 2026 21:41
@mkeeter mkeeter force-pushed the mkeeter/loading-idol-result branch from 2dea381 to 861ffd1 Compare May 14, 2026 16:20
@mkeeter mkeeter force-pushed the mkeeter/hiffy-decode-flat branch from 02dc755 to 27e0c3a Compare May 14, 2026 16:20
@mkeeter mkeeter force-pushed the mkeeter/loading-idol-result branch from 861ffd1 to c3de5fa Compare May 14, 2026 16:48
@mkeeter mkeeter force-pushed the mkeeter/hiffy-decode-flat branch from 27e0c3a to 1e0ed19 Compare May 14, 2026 16:48
@mkeeter mkeeter force-pushed the mkeeter/loading-idol-result branch from c3de5fa to e66628c Compare May 14, 2026 19:08
@mkeeter mkeeter force-pushed the mkeeter/hiffy-decode-flat branch from 1e0ed19 to a35dcb6 Compare May 14, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant