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: all actions should have a parameter that allows for opting into / outof error === exit/skip #288

Open
airtonix opened this issue Dec 11, 2022 · 4 comments

Comments

@airtonix
Copy link
Contributor

Description

Some actions are inconsistent with respects to how they handle errors.

Some will :

  • print error, and continue on with next action in the current manifest.
  • print error, and cause rest of manifest to be ignored.
  • print error, and cause the rest of the entire repo to be ignored.

Perhaps we should think about a way to make this behaviour official and obvious to the user by:

  • providing a flag on each action on_error: die | skip_manifest | continue
  • default to die
  • when a fatal error occurs, print the error with something like :
<the error spam>

if you want to ignore this error, declare: `on_error: continue`, read more: https://comtrya.dev/blah/blah/blah

I'm not sure what you consider the the correct wording and formatting, but essentially it should do two things:

  • show the error
  • help the user get past the error
  • give a link to the deep dive

Additional information
Add more context which didn't fit in the fields above.

@icepuma
Copy link
Member

icepuma commented Dec 18, 2022

We have to get better at detecting errors and fail safely. We're working on this topic. This shouldn't be a thing the user should take care of

@rawkode
Copy link
Member

rawkode commented Dec 24, 2022

Error handling is hard because our Atoms plan function only returns a boolean. We need to modify this to be more sophisticated and explain why a plan says no, which means we can handle error cases a lot better.

Definitely something we should improve in the short term

@martintc
Copy link
Contributor

Could we solve this by returning an Enum with wrapped values?

enum ReturnValue {
  SUCCESS,
  ERROR(String)
}

@rawkode
Copy link
Member

rawkode commented Jan 4, 2023

@airtonix We had a contributor call today about control flow, error handling, and output.

We're going to add a manifest config option which will allow you to indicate a manifest can fail without stopping the apply.

continue_on_error: true

actions:
- ...

As well as this, we're going to rework the output for Comtrya to be more friendly and display better information to the user.

Lastly, we're going to rework error handling all the way down Comtrya to propagate more useful error messages on failures.

Thanks for your issues and continued patience.

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

4 participants