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

[vtadmin] Promote ErrNoSchema to a TypedError which returns http 404 #7885

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented Apr 18, 2021

Signed-off-by: Andrew Mason amason@slack-corp.com

Description

Related Issue(s)

Checklist

  • Should this PR be backported? no
  • Tests were added or are not required n/a
  • Documentation was added or is not required

Deployment Notes

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

Signed-off-by: Andrew Mason <amason@slack-corp.com>
@ajm188 ajm188 requested a review from doeg April 18, 2021 02:32
}

func (e *NoSuchSchema) Code() string { return "no such schema" }
func (e *NoSuchSchema) HTTPStatus() int { return http.StatusNotFound }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open TODO for anyone to swap the rest of our magic numbers in this file to reference the constants in net/http

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean in this PR, or a separate one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Separate one! It's not really related to this change, but something we should do. https://github.com/vitessio/vitess/projects/12#card-59345039

@ajm188 ajm188 changed the title Promote ErrNoSchema to a TypedError which returns http 404 [vtadmin] Promote ErrNoSchema to a TypedError which returns http 404 Apr 18, 2021
Copy link
Contributor

@doeg doeg left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@ajm188 ajm188 merged commit e0df950 into vitessio:master Apr 19, 2021
@ajm188 ajm188 deleted the am_vtadmin_schema_404 branch April 19, 2021 12:26
@systay systay added Component: VTAdmin VTadmin interface Type: Enhancement Logical improvement (somewhere between a bug and feature) labels Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VTAdmin VTadmin interface Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vtadmin-api] /api/schema route should return an error for schemas that don't exist
3 participants