Skip to content

feat: rich gRPC errors#2176

Merged
moul merged 1 commit intomasterfrom
dev/moul/grpc-errors
Jul 20, 2020
Merged

feat: rich gRPC errors#2176
moul merged 1 commit intomasterfrom
dev/moul/grpc-errors

Conversation

@moul
Copy link
Copy Markdown
Member

@moul moul commented Jul 20, 2020

  • adds a new errcode.Has helper
  • adds a new errcode.Codes helper
  • adds a new errcode.Is helper
  • switch int32 with errcode.ErrCode for each available helpers in the library
  • implements func (xxx) GRPCStatus() *status.Status that transforms an errcode.ErrCode to a gRPC status with some attached details
  • update existing tests

Looks stable enough:

$ go test ./pkg/errcode/ -count 1000
ok      berty.tech/berty/v2/go/pkg/errcode      1.129s

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 20, 2020

Codecov Report

Merging #2176 into master will decrease coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2176      +/-   ##
==========================================
- Coverage   54.75%   54.56%   -0.19%     
==========================================
  Files          55       55              
  Lines        4630     4644      +14     
==========================================
- Hits         2535     2534       -1     
- Misses       1618     1626       +8     
- Partials      477      484       +7     
Flag Coverage Δ
#unittests 54.56% <100.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
go/framework/bertybridge/bridge_protocol.go 36.63% <ø> (ø)
go/pkg/bertyprotocol/testing.go 85.93% <ø> (ø)
go/pkg/errcode/error.go 93.44% <100.00%> (+1.95%) ⬆️
go/pkg/bertyprotocol/keystore_device.go 66.39% <0.00%> (-4.92%) ⬇️
go/pkg/bertyprotocol/keystore_message.go 54.81% <0.00%> (-1.49%) ⬇️
go/pkg/bertyprotocol/group.go 67.44% <0.00%> (-1.40%) ⬇️
go/pkg/bertyprotocol/store_metadata.go 61.89% <0.00%> (-0.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bb487a...73c35f5. Read the comment docs.

@moul-bot moul-bot force-pushed the dev/moul/grpc-errors branch from fe2aeae to 5603395 Compare July 20, 2020 21:18
@moul moul self-assigned this Jul 20, 2020
@moul-bot moul-bot force-pushed the dev/moul/grpc-errors branch 2 times, most recently from 8be9f76 to 259ccd2 Compare July 20, 2020 21:47
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul-bot moul-bot force-pushed the dev/moul/grpc-errors branch from 259ccd2 to 73c35f5 Compare July 20, 2020 22:04
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 20, 2020

Expected release notes (by @moul-bot)

features:
rich gRPC errors (73c35f5)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

@moul moul changed the title WIP feat: rich gRPC errors feat: rich gRPC errors Jul 20, 2020
@moul moul marked this pull request as ready for review July 20, 2020 22:21
@moul moul requested review from a team as code owners July 20, 2020 22:21
@moul moul merged commit c4ddb56 into master Jul 20, 2020
@moul moul deleted the dev/moul/grpc-errors branch July 20, 2020 22:22
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.115.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant