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

libcontainer: rm own error system #3033

Merged
merged 3 commits into from
Jul 1, 2021

Commits on Jun 24, 2021

  1. libct/error: rm ConsoleExists

    It is not used since commit 244c9fc.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Jun 24, 2021
    Configuration menu
    Copy the full SHA
    60c647a View commit details
    Browse the repository at this point in the history
  2. libcontainer: rm own error system

    This removes libcontainer's own error wrapping system, consisting of a
    few types and functions, aimed at typization, wrapping and unwrapping
    of errors, as well as saving error stack traces.
    
    Since Go 1.13 now provides its own error wrapping mechanism and a few
    related functions, it makes sense to switch to it.
    
    While doing that, improve some error messages so that they start
    with "error", "unable to", or "can't".
    
    A few things that are worth mentioning:
    
    1. We lose stack traces (which were never shown anyway).
    
    2. Users of libcontainer that relied on particular errors (like
       ContainerNotExists) need to switch to using errors.Is with
       the new errors defined in error.go.
    
    3. encoding/json is unable to unmarshal the built-in error type,
       so we have to introduce initError and wrap the errors into it
       (basically passing the error as a string). This is the same
       as it was before, just a tad simpler (actually the initError
       is a type that got removed in commit afa8443; also suddenly
       ierr variable name makes sense now).
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Jun 24, 2021
    Configuration menu
    Copy the full SHA
    e918d02 View commit details
    Browse the repository at this point in the history
  3. libct/stacktrace: remove

    This removes the libcontainer/stacktrace package, which, as of previous
    commit, is no longer used.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Jun 24, 2021
    Configuration menu
    Copy the full SHA
    e618c02 View commit details
    Browse the repository at this point in the history