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

return 404 code when delete not exist experiment #96

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

kadern0
Copy link
Contributor

@kadern0 kadern0 commented Oct 4, 2021

Fixes #93

 curl -X DELETE 127.0.0.1:31767/api/attack/1234 -w "%{http_code}" 
{"error":true,"message":"error.api.resource_not_found: record not found","code":"error.api.resource_not_found","full_text":"error.api.resource_not_found: record not found\n at github.com/chaos-mesh/chaosd/pkg/server/httpserver.handleError()\n\t/home/pcaderno/go/src/github.com/kadern0/chaosd/pkg/server/httpserver/server.go:277\n at github.com/chaos-mesh/chaosd/pkg/server/httpserver.(*httpServer).recoverAttack()\n\t/home/pcaderno/go/src/github.com/kadern0/chaosd/pkg/server/httpserver/server.go:268\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161\n at github.com/chaos-mesh/chaosd/pkg/server/utils.MWHandleErrors.func1()\n\t/home/pcaderno/go/src/github.com/kadern0/chaosd/pkg/server/utils/error.go:47\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161\n at github.com/gin-gonic/gin.RecoveryWithWriter.func1()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/recovery.go:83\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161\n at github.com/gin-gonic/gin.LoggerWithConfig.func1()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/logger.go:241\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161\n at github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/gin.go:409\n at github.com/gin-gonic/gin.(*Engine).ServeHTTP()\n\t/home/pcaderno/go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/gin.go:367\n at net/http.serverHandler.ServeHTTP()\n\t/usr/local/go/src/net/http/server.go:2887\n at net/http.(*conn).serve()\n\t/usr/local/go/src/net/http/server.go:1952\n at runtime.goexit()\n\t/usr/local/go/src/runtime/asm_amd64.s:1371"}404

Signed-off-by: Pablo Caderno <kaderno@gmail.com>
Copy link
Collaborator

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

Copy link
Member

@Andrewmatilde Andrewmatilde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@WangXiangUSTC WangXiangUSTC merged commit 684f94e into chaos-mesh:main Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

return 404 code when delete not exist experiment
3 participants