diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2017-11-01 14:38:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-01 14:38:21 -0400 |
commit | f5019df3f5da9030ce21e5c8ad3d3921a6585e7f (patch) | |
tree | 05412dcc190ca026dbe51a4ef72bb91ff646e7c6 /libpod/errors.go | |
parent | 2b74391cd5281f6fdf391ff8ad50fd1490f6bf89 (diff) | |
parent | eab0737f1189a7b88f0a37a6b894ca4345b6853f (diff) | |
download | podman-f5019df3f5da9030ce21e5c8ad3d3921a6585e7f.tar.gz podman-f5019df3f5da9030ce21e5c8ad3d3921a6585e7f.tar.bz2 podman-f5019df3f5da9030ce21e5c8ad3d3921a6585e7f.zip |
Merge pull request #1 from mheon/master
Initial checkin
Diffstat (limited to 'libpod/errors.go')
-rw-r--r-- | libpod/errors.go | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/libpod/errors.go b/libpod/errors.go new file mode 100644 index 000000000..245445005 --- /dev/null +++ b/libpod/errors.go @@ -0,0 +1,62 @@ +package libpod + +import ( + "errors" +) + +var ( + // ErrNoSuchCtr indicates the requested container does not exist + ErrNoSuchCtr = errors.New("no such container") + // ErrNoSuchPod indicates the requested pod does not exist + ErrNoSuchPod = errors.New("no such pod") + // ErrNoSuchImage indicates the requested image does not exist + ErrNoSuchImage = errors.New("no such image") + + // ErrCtrExists indicates a container with the same name or ID already + // exists + ErrCtrExists = errors.New("container already exists") + // ErrPodExists indicates a pod with the same name or ID already exists + ErrPodExists = errors.New("pod already exists") + // ErrImageExists indicated an image with the same ID already exists + ErrImageExists = errors.New("image already exists") + + // ErrCtrStateInvalid indicates a container is in an improper state for + // the requested operation + ErrCtrStateInvalid = errors.New("container state improper") + + // ErrRuntimeFinalized indicates that the runtime has already been + // created and cannot be modified + ErrRuntimeFinalized = errors.New("runtime has been finalized") + // ErrCtrFinalized indicates that the container has already been created + // and cannot be modified + ErrCtrFinalized = errors.New("container has been finalized") + // ErrPodFinalized indicates that the pod has already been created and + // cannot be modified + ErrPodFinalized = errors.New("pod has been finalized") + + // ErrInvalidArg indicates that an invalid argument was passed + ErrInvalidArg = errors.New("invalid argument") + // ErrEmptyID indicates that an empty ID was passed + ErrEmptyID = errors.New("name or ID cannot be empty") + + // ErrInternal indicates an internal library error + ErrInternal = errors.New("internal libpod error") + + // ErrRuntimeStopped indicates that the runtime has already been shut + // down and no further operations can be performed on it + ErrRuntimeStopped = errors.New("runtime has already been stopped") + // ErrCtrStopped indicates that the requested container is not running + // and the requested operation cannot be performed until it is started + ErrCtrStopped = errors.New("container is stopped") + + // ErrCtrRemoved indicates that the container has already been removed + // and no further operations can be performed on it + ErrCtrRemoved = errors.New("container has already been removed") + // ErrPodRemoved indicates that the pod has already been removed and no + // further operations can be performed on it + ErrPodRemoved = errors.New("pod has already been removed") + + // ErrNotImplemented indicates that the requested functionality is not + // yet present + ErrNotImplemented = errors.New("not yet implemented") +) |