gotomicro / ego

A simple and component-based microservice kit for go. 一个简单的基于组件的 Go 微服务套件。

Home Page:https://ego-org.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic in handler but retrun code 200

sevennt opened this issue · comments

commented

Handler 中 panic,egin 却依然返回 200 code。

func Import(ctx *gin.Context) {
	for _, s := range something {
    	    Panic()
	}
        // 此处仍然能继续返回
	ctx.JSON(200, map[string]interface{}{"result": "ok"})
}

func  Panic(){
  panic("don't panic")
}

所以可以关闭了么?