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

Non-retryable errors #2

Open
happylinks opened this issue Aug 10, 2023 · 3 comments
Open

Non-retryable errors #2

happylinks opened this issue Aug 10, 2023 · 3 comments

Comments

@happylinks
Copy link

Hey! Do you know if/how I can return an ApplicationFailure with non_retryable: true?
https://docs.temporal.io/kb/failures#non-retryable

Right now we have

#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
    #[error(transparent)]
    Io(#[from] std::io::Error),
    #[error(transparent)]
    Any(anyhow::Error),
}

impl FromFailureExt for Error {
    fn from_failure(failure: Failure) -> Error {
        Error::Any(anyhow::anyhow!("{:?}", failure.message))
    }
}

But I couldn't find how to return a Failure, or extend the Error in a way that would pass that in a good way.
Thanks!

@h7kanna
Copy link
Owner

h7kanna commented Aug 10, 2023

Hi, I'm sorry for not getting back to you sooner.

I am in the process of defining the API as I use it in my worker codebase. yet to hit a use-case of 'non-retrybale' in my workflows.
Also, currently, there are other issues with API as well which I found recently, for example, handling cancellations, etc.

I will definitely find some time to refine the API soon, as I am attending next month's Replay conference and want to discuss it with the maintainers

@happylinks
Copy link
Author

happylinks commented Aug 11, 2023

Sounds good! No rush for answering my issues. Nice that you're gonna discuss it with the maintainers! Just for background, I released my first rust worker to prod yesterday, and so far it's working great. We're a very small startup so I don't mind that it's still unstable.
Thanks for the work, I'd love to keep using it in the future.
Do you think it's fine if I keep reporting the things I run into right now, you don't have to feel pressured to fix it obviously, or would you rather wait until you give the green light on a future version?

@h7kanna
Copy link
Owner

h7kanna commented Aug 11, 2023

Sure, Please do report the issues.
I will keep you updated if I am making any changes to the API as well.

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

2 participants