Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error wrapping #1347

Merged
merged 40 commits into from
Aug 15, 2022
Merged

Error wrapping #1347

merged 40 commits into from
Aug 15, 2022

Conversation

libmonsoon-dev
Copy link
Contributor

With these changes, the following code

import (
	"strconv"
)

const str = "test"

func foo(arg string) (int, error) {
	return strconv.Atoi(arg)?, nil
}

func bar(arg string) (int, error) {
	fn := foo

	return fn(arg)?, nil
}

func baz(arg string) (int, error) {
	return bar(arg)?, nil
}

println baz(str)

will print the following

0 strconv.Atoi: parsing "test": invalid syntax

===> errors stack:
main.foo()
        cmd/test/main.gop:8 strconv.Atoi(arg)
main.bar()
        cmd/test/main.gop:14 fn(arg)
main.baz()
        cmd/test/main.gop:18 bar(arg)

lookupFromCache hotfix: errors.Unwrap
@@ -0,0 +1 @@
v1.1.3
Copy link
Member

@xushiwei xushiwei Aug 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add VERSION file into the main branch (it can only exist in release branches).

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2022

Codecov Report

Merging #1347 (c655a50) into main (0c434fe) will increase coverage by 0.00%.
The diff coverage is 93.10%.

@@           Coverage Diff           @@
##             main    #1347   +/-   ##
=======================================
  Coverage   90.99%   90.99%           
=======================================
  Files          22       22           
  Lines        8524     8551   +27     
=======================================
+ Hits         7756     7781   +25     
- Misses        618      619    +1     
- Partials      150      151    +1     
Impacted Files Coverage Δ
cl/expr.go 95.67% <93.10%> (-0.12%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@xushiwei xushiwei merged commit 21663a1 into goplus:main Aug 15, 2022
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.

3 participants