context.go
func (ctx *Context) Fail(err error) {
	if err == nil {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln("Context.Fail: err is nil")
		ctx.ResponseWriter.WriteHeader(http.StatusInternalServerError)
		ctx.ResponseWriter.Write(nil)
		return
	}

	if ctx.written == true {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln("Context.Fail: request has been writed")
		return
	}

	errno := 0
	errCore, ok := err.(ICoreError)
	if ok == true {
		errno = errCore.GetErrno()
	}
	ctx.written = true
	if Production == false {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln(err.Error())
	} else if _, ok := err.(*ServerError); ok == true {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln(err.Error())
	}

	var json = jsoniter.ConfigCompatibleWithStandardLibrary
	b, _ := json.Marshal(&ResFormat{Ok: false, Message: err.Error(), Errno: errno})

	coreErr, ok := err.(ICoreError)
	if ok == true {
		ctx.ResponseWriter.WriteHeader(coreErr.GetHTTPCode())
	} else {
		ctx.ResponseWriter.WriteHeader(http.StatusInternalServerError)
	}
	ctx.ResponseWriter.Write(b)
}
func (ctx *Context) Fail(err error) {
	if err == nil {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln("Context.Fail: err is nil")
		ctx.ResponseWriter.WriteHeader(http.StatusInternalServerError)
		ctx.ResponseWriter.Write(nil)
		return
	}

	if ctx.written == true {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln("Context.Fail: request has been writed")
		return
	}

	errno := 0
	errCore, ok := err.(ICoreError)
	if ok == true {
		errno = errCore.GetErrno()
	}
	ctx.written = true
	if Production == false {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln(err.Error())
	} else if _, ok := err.(*ServerError); ok == true {
		log.WithFields(log.Fields{"path": ctx.Request.URL.Path}).Warnln(err.Error())
	}

	var json = jsoniter.ConfigCompatibleWithStandardLibrary
	b, _ := json.Marshal(&ResFormat{Ok: false, Message: err.Error(), Errno: errno})

	coreErr, ok := err.(ICoreError)
	if ok == true {
		ctx.ResponseWriter.WriteHeader(coreErr.GetHTTPCode())
	} else {
		ctx.ResponseWriter.WriteHeader(http.StatusInternalServerError)
	}
	ctx.ResponseWriter.Write(b)
}
// Fail Response fail