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

refactor: make parse http error code public #511

Merged
merged 4 commits into from
Aug 11, 2022
Merged

Conversation

ClSlaid
Copy link
Contributor

@ClSlaid ClSlaid commented Aug 11, 2022

Summary

  1. now all http related service use public parse_http_error_code
    function
  2. update gitignore

Signed-off-by: ClSlaid cailue@bupt.edu.cn

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

1. now all http related service use public parse_http_error_code
   function
2. update gitignore

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
@Xuanwo
Copy link
Member

Xuanwo commented Aug 11, 2022

Please resolve conflicts before reviewing.

@Xuanwo Xuanwo changed the title [refactor]: make parse http error code public refactor: make parse http error code public Aug 11, 2022
@Xuanwo
Copy link
Member

Xuanwo commented Aug 11, 2022

I'm a bit worried about this refactor: because different services could have a different meanings for the same status code.

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
@ClSlaid
Copy link
Contributor Author

ClSlaid commented Aug 11, 2022

I'm a bit worried about this refactor: because different services could have a different meanings for the same status code.

We can wrap this up for further configurations into a trait, and make the function the default implementation.

For now, those functions are literally the same. The only difference between them is their visibility.

@Xuanwo
Copy link
Member

Xuanwo commented Aug 11, 2022

I don't like the idea to extract a trait for such simple thing...

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
@Xuanwo
Copy link
Member

Xuanwo commented Aug 11, 2022

For now, those functions are literally the same. The only difference between them is their visibility.

Makes sense to me.

Service can implement their own error kind parser if needed.

src/http_util/error.rs Outdated Show resolved Hide resolved
rename parse_http_error_code to parse_error_status_code

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
@Xuanwo Xuanwo merged commit 624a63f into apache:main Aug 11, 2022
@ClSlaid ClSlaid deleted the io_util_comp branch August 16, 2022 06:38
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.

2 participants