You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "bonsairobo (via GitHub)" <gi...@apache.org> on 2025/09/22 18:46:08 UTC

[I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

bonsairobo opened a new issue, #6586:
URL: https://github.com/apache/opendal/issues/6586

   ### Describe the bug
   
   I am trying to `impl HttpFetch` for a newtype wrapper around `reqwest_middleware::ClientWithMiddleware` by copying the code from `impl HttpFetch for reqwest::Client`. This almost works except we can't call `Error::with_temporary` because it's private.
   
   ### Steps to Reproduce
   
   Try calling `Error::with_temporary`.
   
   ### Expected Behavior
   
   `Error::with_temporary` can be called.
   
   ### Additional Context
   
   _No response_
   
   ### Are you willing to submit a PR to fix this bug?
   
   - [x] Yes, I would like to submit a PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

Posted by "bonsairobo (via GitHub)" <gi...@apache.org>.
bonsairobo commented on issue #6586:
URL: https://github.com/apache/opendal/issues/6586#issuecomment-3407416751

   @Xuanwo Yea I think I'll have time today


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #6586:
URL: https://github.com/apache/opendal/issues/6586#issuecomment-3320807229

   <!-- Greeting -->
   Hi @bonsairobo! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the opendal team.
   
   <!-- Answer -->
   The reason you can't call `Error::with_temporary` is that it's private, which restricts its use to within its defining module. However, you don't necessarily need it to implement `HttpFetch` for your newtype. The codebase uses public error construction methods like `Error::new` with chaining methods such as `with_operation`, `with_context`, and `set_source` to build errors for HTTP operations. This pattern is public and should work for your use case as well—see [this example](https://github.com/apache/opendal/issues/6123) from the repo.
   
   If you want to proceed with a PR, you could either propose making `with_temporary` public (if you have a strong use case), or adapt your implementation to use the public error constructors and chaining methods, which is the current recommended approach.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/a113cf37-7155-47c8-bce9-8ab2457b62b7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a113cf37-7155-47c8-bce9-8ab2457b62b7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a113cf37-7155-47c8-bce9-8ab2457b62b7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a113cf37-7155-47c8-bce9-8ab2457b62b7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a113cf37-7155-47c8-bce9-8ab2457b62b7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a113cf37-7155-47c8-bce9-8ab2457b62b7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a113cf37-7155-47c8-bce9-8ab2457b62b7?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/997a2c5a-0c54-497b-989d-44651635dd36/ask?utm_source=githu
 b)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/opendal/issues/6586)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

Posted by "bonsairobo (via GitHub)" <gi...@apache.org>.
bonsairobo closed issue #6586: bug: `Error::with_temporary` is private, but required to implement `HttpFetch`
URL: https://github.com/apache/opendal/issues/6586


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #6586:
URL: https://github.com/apache/opendal/issues/6586#issuecomment-3320851519

   <!-- Answer -->
   You're right—there's currently no public way to set the inner ErrorStatus or mark an error as temporary, which is necessary for correct behavior from Error::is_temporary. The official HttpFetch impl for reqwest::Client uses the private Error::with_temporary, and there aren't any public alternatives or patterns in the codebase for this.
   
   If you want to proceed, proposing a PR to make Error::with_temporary public or to add a public API for marking errors as temporary would be a reasonable next step. Let me know if you'd like help drafting that!
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/06be81e8-6c64-4e39-8569-6a0ba4f5b30b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/06be81e8-6c64-4e39-8569-6a0ba4f5b30b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/06be81e8-6c64-4e39-8569-6a0ba4f5b30b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/06be81e8-6c64-4e39-8569-6a0ba4f5b30b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/06be81e8-6c64-4e39-8569-6a0ba4f5b30b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/06be81e8-6c64-4e39-8569-6a0ba4f5b30b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/06be81e8-6c64-4e39-8569-6a0ba4f5b30b?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/997a2c5a-0c54-497b-989d-44651635dd36/ask?utm_source=githu
 b)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/opendal/issues/6586)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

Posted by "bonsairobo (via GitHub)" <gi...@apache.org>.
bonsairobo commented on issue #6586:
URL: https://github.com/apache/opendal/issues/6586#issuecomment-3409074038

   Looks like this was solved by #6513 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

Posted by "bonsairobo (via GitHub)" <gi...@apache.org>.
bonsairobo commented on issue #6586:
URL: https://github.com/apache/opendal/issues/6586#issuecomment-3320844268

   @dosu
   
   > This pattern is public and should work for your use case as well
   
   None of the public methods on `Error` allow me to set the inner `ErrorStatus` field, which is required to get the correct behavior from `Error::is_temporary`. I assume there is a good reason that this behavior is necessary in `impl HttpFetch for reqwest::Client`, which is why I'm trying to copy it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: `Error::with_temporary` is private, but required to implement `HttpFetch` [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #6586:
URL: https://github.com/apache/opendal/issues/6586#issuecomment-3405869462

   I'm open to make it public. Do you have interest in doing this? @bonsairobo 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org