feat: better error handling #17

Merged
decentral1se merged 5 commits from feat/errors into main 2026-07-31 19:40:04 +00:00
Owner

@cblgh no rush on this. I have gone back and forth on this and I think it's ready for another pair of eyeballs. What do you think of the error checking API in examples/errors/errors.go?

Internals nerd zone Sadly, iroh will not give us the `IrohError` directly from the API. That is what we want because it gives us the detailed error message in `IrohError.Message()`. So, we need to kind of wrap up some sort of convenient conversion and also preserve the `err != nil` checks that you usually expect. It's too verbose to have to do this every time we receive an `error` on the API consumer side. That's the `iroh.As` API. `errors.Is` is supported in general now.

Refs:

@cblgh no rush on this. I have gone back and forth on this and I think it's ready for another pair of eyeballs. What do you think of the error checking API in [`examples/errors/errors.go`](https://git.coopcloud.tech/decentral1se/iroh-go/pulls/17/files#diff-6cb0de32597996783d2aaba15d6cf0b38590e440)? <details><summary>Internals nerd zone</summary> Sadly, iroh will not give us the `IrohError` directly from the API. That is what we want because it gives us the detailed error message in `IrohError.Message()`. So, we need to kind of wrap up some sort of convenient conversion and also preserve the `err != nil` checks that you usually expect. It's too verbose to have to do this every time we receive an `error` on the API consumer side. That's the `iroh.As` API. `errors.Is` is supported in general now. </details> Refs: - https://github.com/n0-computer/iroh-ffi/pull/267 - https://antonz.org/accepted/errors-astype/ - https://git.coopcloud.tech/decentral1se/iroh-go/issues/10
decentral1se added 1 commit 2026-07-23 15:58:06 +00:00
decentral1se force-pushed feat/errors from 18c424ee54 to 412c2f48ea 2026-07-23 15:58:06 +00:00 Compare
decentral1se marked the pull request as ready for review 2026-07-23 15:58:16 +00:00
cblgh added 1 commit 2026-07-31 16:24:13 +00:00
Collaborator

@decentral1se hero! this looks really nice to use. really appreciate the added example as a way to document / learn how to use it
added a commit with some fixes i found while reading through the code cf4b3933e4

merge away!

@decentral1se hero! this looks really nice to use. really appreciate the added example as a way to document / learn how to use it added a commit with some fixes i found while reading through the code https://git.coopcloud.tech/decentral1se/iroh-go/commit/cf4b3933e48f412f6e20620998234724b1bdd8e1 merge away!
decentral1se added 1 commit 2026-07-31 19:34:45 +00:00
decentral1se force-pushed feat/errors from 9fc52d6c7e to 55d5a11754 2026-07-31 19:38:01 +00:00 Compare
decentral1se added 2 commits 2026-07-31 19:39:38 +00:00
docs: build badge
continuous-integration/drone/push Build is passing
3b6f179add
decentral1se force-pushed feat/errors from 55d5a11754 to 3b6f179add 2026-07-31 19:39:38 +00:00 Compare
decentral1se merged commit 985d1b3684 into main 2026-07-31 19:40:04 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: decentral1se/iroh-go#17