Skip to content

server: standardize error handling across all RPC endpoints#76292

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20220209-api-errs
Feb 10, 2022
Merged

server: standardize error handling across all RPC endpoints#76292
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20220209-api-errs

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Feb 9, 2022

Arguably, there is still a lot of boilerplate in here, so a later
iteration of this work could consider handling errors at a higher
level.

However, before we can do this we want all the API handlers to handle
errors in a consistent manner, so that there's no surprise left during
the later refactoring.

This change also takes care of logging a few errors that were not
logged before.

Release note: None

@knz knz requested review from a team, dhartunian, maryliag and rimadeodhar February 9, 2022 14:48
@blathers-crl blathers-crl bot added the T-server-and-security DB Server & Security label Feb 9, 2022
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 9, 2022

cc @jocrl for your consideration. NB: this does not fix #76288, it merely points it out.

Arguably, there is still a lot of boilerplate in here, so a later
iteration of this work could consider handling errors at a higher
level.

However, before we can do this we want all the API handlers to handle
errors in a consistent manner, so that there's no surprise left during
the later refactoring.

This change also takes care of logging a few errors that were not
logged before.

Release note: None
@knz knz force-pushed the 20220209-api-errs branch from bee6c28 to d679dd0 Compare February 9, 2022 16:41
Copy link
Copy Markdown
Contributor

@jocrl jocrl left a comment

Choose a reason for hiding this comment

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

Thanks! The comment and highlight of other examples to fix the bug is helpful and looks good.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dhartunian, @maryliag, and @rimadeodhar)

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 9, 2022

Thanks josephine!

bors r=jocrl

@craig craig bot merged commit 0fdf716 into cockroachdb:master Feb 10, 2022
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 10, 2022

Build succeeded:

@knz knz deleted the 20220209-api-errs branch February 10, 2022 07:43
craig bot pushed a commit that referenced this pull request Feb 11, 2022
76294: server: make the Drain interfaces available to SQL-only servers r=cameronnunez,JeffSwenson a=knz

Fixes #74412

First commit from #76292; the reviewers are invited to ignore it in this PR.

See individual commits for details.

cc @cockroachdb/obs-inf-prs 

Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-server-and-security DB Server & Security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants