MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / WriteTo

Method WriteTo

pkg/error/error.go:169–181  ·  view source on GitHub ↗

WriteTo xxx

(w http.ResponseWriter)

Source from the content-addressed store, hash-verified

167
168// WriteTo xxx
169func (err FinalError) WriteTo(w http.ResponseWriter) FinalError {
170
171 w.Header().Set("Content-Type", "application/json")
172 w.Header().Set("X-Amzn-ErrorType", string(err.Code))
173 w.Header().Set("X-Bce-ErrorType", string(err.Code))
174
175 w.WriteHeader(err.Status)
176
177 b, _ := json.Marshal(err)
178 w.Write(b)
179
180 return err
181}
182
183// NewValidationException xxx
184func NewValidationException(cause, message string, lasterr error) FinalError {

Callers 10

ContainerListHandlerMethod · 0.80
ContainerInfoHandlerMethod · 0.80
WarmUpHandlerMethod · 0.80
IDEWarmUpHandlerMethod · 0.80
CoolDownHandlerMethod · 0.80
RebornHandlerMethod · 0.80
ResetHandlerMethod · 0.80
GetNodeHandlerMethod · 0.80
SimpleAuthTokenVerifyFunction · 0.80
handleRootHealthzFunction · 0.80

Calls 5

MarshalFunction · 0.92
SetMethod · 0.65
WriteMethod · 0.65
HeaderMethod · 0.45
WriteHeaderMethod · 0.45

Tested by

no test coverage detected