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 error handling #303

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Jan 10, 2024

  1. commands: Rework newQemuHelper to bubble-up error instead of panicing

    Rather than panicing on error, bubble up an error so that the execution
    may recover correctly and the error shown to the user.
    
    Fixes: go-debos#413
    Signed-off-by: Christopher Obbard <[email protected]>
    obbardc committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    0f9b045 View commit details
    Browse the repository at this point in the history
  2. Rework error handling to check context.State

    Currently the debos error handling sets an exitcode during the run, then
    exits with that code once execution has finished. This paradigm is quite
    fragile, so let's switch around the error handling to use context.State
    to track errors and check the state of this variable after the run has
    completed.
    
    While we are here, rename the checkError function to handleError to better
    describe the function's intent and make it return a boolean to show that
    an error has been handled. Rework the do_run function to also return a
    boolean to show that an error occurred during the run.
    
    Signed-off-by: Christopher Obbard <[email protected]>
    obbardc committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    a3fbde3 View commit details
    Browse the repository at this point in the history
  3. Fix typo in stage name Postmachine→PostMachine

    Signed-off-by: Christopher Obbard <[email protected]>
    obbardc committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    64d043d View commit details
    Browse the repository at this point in the history
  4. debos: Improve error messages

    Rework the error handling to show where an error occured during the run.
    Also print all error messages to the log rather than stdout.
    
    Signed-off-by: Christopher Obbard <[email protected]>
    obbardc committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    aa1e5a0 View commit details
    Browse the repository at this point in the history