proposal: implement `Error` interface for error types
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading issue #127 and locating the error types and SDK helper shown in this issue. Determine which error values need Error methods and verify that SDK callers can return them directly; replacing hyphens with spaces is optional.
Written by the indexing model from the issue text.
Description
building upon #127, can we add an Error method to error types so that in our sdk's we can directly return the error instead of having to map it to error msgs manually.
e.g. following method in the sdk could be just removed if we had that.
func errorVariantToError(err abc.Error) error {
switch {
case abc.ErrorInputNotSupported() == err:
return fmt.Errorf("input not supported")
case abc.RuntimeError() == err:
return fmt.Errorf("runtime error")
case abc.InvalidInput() == err:
return fmt.Errorf("invalid input")
default:
return fmt.Errorf("no error provided by host implementation")
}
}
Another thing we could possibly do is to replace "-" with " " automatically (to make it more readable), but its just a nice to have item.
- Dominant language
- Go
- Stars
- 148
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Contributor 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 bytecodealliance/go-modules
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
bytecodealliance/go-modules#428 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
bytecodealliance/go-modules#411 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
bytecodealliance/go-modules#410 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
bytecodealliance/go-modules#394 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
bytecodealliance/go-modules#377 · 1 comment ·
All issues in bytecodealliance/go-modules
Similar issues
-
bug carvel-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
carvel-dev/kapp-controller#1861 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100