summaryrefslogtreecommitdiff
path: root/pkg/errorhandling/errorhandling.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-12 19:37:46 +0100
committerGitHub <noreply@github.com>2021-11-12 19:37:46 +0100
commit4808a63e5f1ad72d754c61c005c2c7c29ce48014 (patch)
tree3cfdd9e9f89024798a1bcd26dd56d4c7140d923d /pkg/errorhandling/errorhandling.go
parentfd010adfdcb6f578623b77281f2ae012bcd1ac85 (diff)
parent7c98d542b4c5ab0495f66a9179ae886e86cad273 (diff)
downloadpodman-4808a63e5f1ad72d754c61c005c2c7c29ce48014.tar.gz
podman-4808a63e5f1ad72d754c61c005c2c7c29ce48014.tar.bz2
podman-4808a63e5f1ad72d754c61c005c2c7c29ce48014.zip
Merge pull request #12274 from mheon/bump_342
Bump to v3.4.2
Diffstat (limited to 'pkg/errorhandling/errorhandling.go')
-rw-r--r--pkg/errorhandling/errorhandling.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/errorhandling/errorhandling.go b/pkg/errorhandling/errorhandling.go
index 6adbc9f34..fcb0f7881 100644
--- a/pkg/errorhandling/errorhandling.go
+++ b/pkg/errorhandling/errorhandling.go
@@ -83,6 +83,12 @@ func Contains(err error, sub error) bool {
return strings.Contains(err.Error(), sub.Error())
}
+// PodConflictErrorModel is used in remote connections with podman
+type PodConflictErrorModel struct {
+ Errs []string
+ Id string //nolint
+}
+
// ErrorModel is used in remote connections with podman
type ErrorModel struct {
// API root cause formatted for automated parsing
@@ -106,3 +112,11 @@ func (e ErrorModel) Cause() error {
func (e ErrorModel) Code() int {
return e.ResponseCode
}
+
+func (e PodConflictErrorModel) Error() string {
+ return strings.Join(e.Errs, ",")
+}
+
+func (e PodConflictErrorModel) Code() int {
+ return 409
+}