MCPcopy Index your code
hub / github.com/dagger/dagger / WriteTo

Method WriteTo

engine/server/session.go:2259–2272  ·  view source on GitHub ↗
(w http.ResponseWriter)

Source from the content-addressed store, hash-verified

2257}
2258
2259func (e gqlError) WriteTo(w http.ResponseWriter) {
2260 gqlerr := &gqlerror.Error{
2261 Err: e.error,
2262 Message: e.Error(),
2263 }
2264 res := graphql.Response{
2265 Errors: gqlerror.List{gqlerr},
2266 }
2267 bytes, err := json.Marshal(res)
2268 if err != nil {
2269 panic(err)
2270 }
2271 http.Error(w, string(bytes), e.httpCode)
2272}
2273
2274// httpHandlerFunc lets you write an http handler that just returns an error, which will be
2275// turned into a 500 http response if non-nil, or a specific code if the error is of type httpError.

Callers 4

httpHandlerFuncFunction · 0.95
mainFunction · 0.45
newGenCmdFunction · 0.45
handleResponseFunction · 0.45

Calls 2

MarshalMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected