Skip to content

fix: Use correct error codes#514

Merged
kodiakhq[bot] merged 2 commits intomainfrom
fix/error_codes
Dec 18, 2022
Merged

fix: Use correct error codes#514
kodiakhq[bot] merged 2 commits intomainfrom
fix/error_codes

Conversation

@yevgenypats
Copy link
Copy Markdown
Contributor

This is uses correct error codes for gRPC in most places. We use Internal and this is the intedded error code for server errors. This is also used by the grpc server as well but it doesn't mean it is only for the gRPC code. See documentation:

https://pkg.go.dev/google.golang.org/grpc/codes#Code
https://cloud.google.com/apis/design/errors

The right codes for internal error are Unknown (The default one) and Internal

@github-actions github-actions bot added the fix label Dec 17, 2022
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 17, 2022

⏱️ Benchmark results

  • DefaultConcurrency-2 resources/s: 11,611
  • Glob-2 ns/op: 150.3
  • TablesWithChildrenDefaultConcurrency-2 resources/s: 31,058
  • BufferedScanner-2 ns/op: 9.394
  • LogReader-2 ns/op: 29.83

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

May I suggest we don't set the error code at all and only keep the default Unknown for now?

We don't use neither one as we never check the error code on the client side.

I don't have a strong opinion here so approving

@yevgenypats
Copy link
Copy Markdown
Contributor Author

We indeed are not using it either way as most of the error are internal and thus fatal but this will be just nicer to the user i.e seeing internal error rather then unknown imo as this put it inline wither other servers.

@kodiakhq kodiakhq bot merged commit 8b53d76 into main Dec 18, 2022
@kodiakhq kodiakhq bot deleted the fix/error_codes branch December 18, 2022 07:58
kodiakhq bot pushed a commit that referenced this pull request Dec 19, 2022
🤖 I have created a release *beep* *boop*
---


## [1.12.6](v1.12.5...v1.12.6) (2022-12-18)


### Bug Fixes

* Add better logging/metric per table ([#513](#513)) ([da36396](da36396))
* Improve formatting of newlines in markdown files ([#492](#492)) ([e48ff90](e48ff90))
* Include table name in logs on panic ([#505](#505)) ([a0b8a46](a0b8a46))
* Move source & destination plugin code to separate packages ([#516](#516)) ([6733785](6733785))
* Use correct error codes ([#514](#514)) ([8b53d76](8b53d76))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants