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

chore: Fix error message for invalid copy-to #2216

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

vrongmeal
Copy link
Contributor

Simple update to error message.

Signed-off-by: Vaibhav <vrongmeal@gmail.com>
@vrongmeal vrongmeal enabled auto-merge (squash) December 6, 2023 15:04
@vrongmeal vrongmeal changed the title chore: Update error message for invalid copy-to chore: Fix error message for invalid copy-to Dec 6, 2023
@@ -52,6 +52,11 @@ pub enum PlanError {
#[error("Invalid alter statement: {msg}")]
InvalidAlterStatement { msg: &'static str },

#[error("Invalid copy to statement: {source}")]
InvalidCopyToStatement {
source: Box<dyn std::error::Error + Send + Sync>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

ValidationError::CredentialsNotSupportedByDatasource

this error is always going to a Validation error, seems like we don't need the generic here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, not really. Right now it is. But this is a flexible error to mark any invalid copy to statement. Something like InvalidCopyToStatement(ValidationError) implies that you can only have an invalid copy to statement due to a validation of options issue.

Copy link
Collaborator

@tychoish tychoish left a comment

Choose a reason for hiding this comment

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

lgtm modulo maybe type change.

@vrongmeal vrongmeal merged commit cd7178c into main Dec 6, 2023
10 checks passed
@vrongmeal vrongmeal deleted the vrongmeal/better-copyto-error branch December 6, 2023 16:30
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.

None yet

2 participants