-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
API returns 500 in case network is not found instead of 404 #7188
API returns 500 in case network is not found instead of 404 #7188
Conversation
c87ad9a
to
902184b
Compare
pkg/api/handlers/compat/networks.go
Outdated
@@ -2,6 +2,7 @@ package compat | |||
|
|||
import ( | |||
"encoding/json" | |||
"github.com/containers/podman/v2/libpod/define" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this should go in the batch that starts on line 13
pkg/api/handlers/libpod/networks.go
Outdated
@@ -2,13 +2,13 @@ package libpod | |||
|
|||
import ( | |||
"encoding/json" | |||
"github.com/containers/podman/v2/libpod/define" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this should go in the batch that starts on line 8
pkg/network/files.go
Outdated
@@ -3,6 +3,7 @@ package network | |||
import ( | |||
"encoding/json" | |||
"fmt" | |||
"github.com/containers/podman/v2/libpod/define" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this should go in the batch that starts on line 13
pkg/network/network.go
Outdated
@@ -2,6 +2,7 @@ package network | |||
|
|||
import ( | |||
"encoding/json" | |||
"github.com/containers/podman/v2/libpod/define" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this should go in the batch that starts on line 11
test/apiv2/35-networks.at
Outdated
|
||
t GET /networks/non-existing-network 404 | ||
|
||
# vim: filetype=sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing newline at end of file
Signed-off-by: zhangguanzhang <[email protected]>
902184b
to
45b100d
Compare
@orenbm thanks |
@vrothberg PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon, zhangguanzhang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -20,10 +19,6 @@ const ( | |||
DefaultPodmanDomainName = "dns.podman" | |||
) | |||
|
|||
var ( | |||
ErrNetworkNotFound = errors.New("network not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been left and just a redirect to define.ErrNetowrkNotFound, otherwise you are changing the API.
Signed-off-by: zhangguanzhang [email protected]
Fixes: #7184