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

ui: add PGCode to admin api errors #98601

Merged
merged 1 commit into from
Mar 16, 2023
Merged

ui: add PGCode to admin api errors #98601

merged 1 commit into from
Mar 16, 2023

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Mar 14, 2023

Adding the PGCode makes it easy to identify
the underlying issue of why the request failed.

old error:

RequestError: An internal server error has occurred.
Please check your CockroachDB logs for more details.

new error

RequestError: An internal server error has occurred. 
Please check your CockroachDB logs for more details. Error Code: 53200

Screenshot 2023-03-14 at 2 51 57 PM

Epic: none
Closes: #98596

Release note: none

@j82w j82w requested review from dhartunian and a team March 14, 2023 17:47
@j82w j82w requested review from a team as code owners March 14, 2023 17:47
@blathers-crl
Copy link

blathers-crl bot commented Mar 14, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dhartunian and @j82w)


-- commits line 13 at r1:
Yay!!
Just wondering if we should use PGCode or just Error Code
thoughts @kevin-v-ngo ?

@kevin-v-ngo
Copy link

Reviewed 1 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dhartunian and @j82w)

-- commits line 13 at r1: Yay!! Just wondering if we should use PGCode or just Error Code thoughts @kevin-v-ngo ?

Although the majority are PG error codes, we do have a subset of CRDB specific errors. So not opposed to just Error Code.

Adding the Error Code makes it easy to identify
the underlying issue of why the request failed.

old error:
```RequestError: An internal server error has occurred.
Please check your CockroachDB logs for more details.```

new error
```RequestError: An internal server error has occurred.
Please check your CockroachDB logs for more details. Error Code: 53200```

Epic: none
Closes: #98596

Release note: none
@j82w
Copy link
Contributor Author

j82w commented Mar 15, 2023

-- commits line 13 at r1:

Previously, maryliag (Marylia Gutierrez) wrote…

Yay!!
Just wondering if we should use PGCode or just Error Code
thoughts @kevin-v-ngo ?

I'm good either way. I went ahead and switched it to Error Code.

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 3 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dhartunian and @kevin-v-ngo)

@maryliag
Copy link
Contributor

can you also backport this to 22.2 and 22.1?

Copy link
Collaborator

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

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

:lgtm: nice!

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @kevin-v-ngo)

@j82w
Copy link
Contributor Author

j82w commented Mar 16, 2023

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 16, 2023

Build succeeded:

@craig craig bot merged commit 81a9f1d into cockroachdb:master Mar 16, 2023
@blathers-crl
Copy link

blathers-crl bot commented Mar 16, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from b6e0f76 to blathers/backport-release-22.1-98601: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.1.x failed. See errors above.


error creating merge commit from b6e0f76 to blathers/backport-release-22.2-98601: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

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.

admin api: Add PGCode to generic message
5 participants