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

[FEATURE] Handle sql.ServiceError() as error interface #844

Open
rariyama opened this issue Mar 5, 2024 · 0 comments
Open

[FEATURE] Handle sql.ServiceError() as error interface #844

rariyama opened this issue Mar 5, 2024 · 0 comments

Comments

@rariyama
Copy link

rariyama commented Mar 5, 2024

Thank you for the gread library. This is my first issue so I'm sorry if this issue is missing the point in advance.

Problem Statement
When executing sql via StatementExecutionAPI, we'll get the execution status as sql.StatementStatus.
If both API and SQL execution succeed, one of the values like SUCCEEDED is assigned to State and Error becomes nil wheares If SQL execution fails, some of the values like error reasons will be assigned to sql.ServiceError
This struct is related to error, then it'll be more useful to handle the struct as error interface. For example, it'll be possible to compare via errors.As() method if it can be handled as error interface.

Proposed Solution
Add Error() function to meet the requirements of error interface.

Additional Context
I'll cooperate about this task as much as possible.

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

No branches or pull requests

1 participant