{"record":{"id":"b96c364e196fb72a","repo":"dagger/dagger","slug":"e-error","errorCode":null,"errorMessage":"e.Error()","messagePattern":"e\\.Error\\(\\)","errorType":"http","errorClass":"httpError","httpStatus":null,"severity":"error","filePath":"engine/server/session.go","lineNumber":3030,"sourceCode":"\nfunc (srv *Server) EngineVolumeState() core.EngineVolumeState {\n\treturn core.EngineVolumeState{\n\t\tRootDir:                    srv.rootDir,\n\t\tRecursiveReadOnlySupported: srv.recursiveReadOnlyMounts,\n\t}\n}\n\ntype httpError struct {\n\terror\n\tcode int\n}\n\nfunc httpErr(err error, code int) httpError {\n\treturn httpError{err, code}\n}\n\nfunc (e httpError) WriteTo(w http.ResponseWriter) {\n\thttp.Error(w, e.Error(), e.code)\n}\n\ntype gqlError struct {\n\terror\n\thttpCode int\n}\n\nfunc gqlErr(err error, httpCode int) gqlError {\n\treturn gqlError{err, httpCode}\n}\n\nfunc (e gqlError) WriteTo(w http.ResponseWriter) {\n\tgqlerr := &gqlerror.Error{\n\t\tErr:     e.error,\n\t\tMessage: e.Error(),\n\t}\n\tres := graphql.Response{\n\t\tErrors: gqlerror.List{gqlerr},","sourceCodeStart":3012,"sourceCodeEnd":3048,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/engine/server/session.go#L3012-L3048","documentation":"This is the httpError type's Error() used when writing an HTTP error response: http.Error(w, e.Error(), e.code). The reported error text is simply the message of an httpError produced by the server's HTTP handler when a wrapped error carries an explicit HTTP status code.","triggerScenarios":"A handler wrapped by httpHandlerFunc returns an error that errors.As matches to httpError; WriteTo emits it with the configured code.","commonSituations":"Client sees a plain-text HTTP error body (e.g. 4xx/5xx) from the engine's session HTTP endpoint; server-side failures surfaced through the error-returning handler path.","solutions":["Inspect the HTTP status code and message body returned by the engine endpoint","Look upstream for the original error that was converted via httpErr(err, code)","Fix the underlying condition that caused the handler to return the error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if resp.StatusCode >= 400 { /* body carries httpError text */ }","typeGuard":null,"tryCatchPattern":"if resp.StatusCode != 200 {\n\tbody, _ := io.ReadAll(resp.Body)\n\treturn fmt.Errorf(\"engine http %d: %s\", resp.StatusCode, body)\n}","preventionTips":["Check HTTP status before parsing responses","Log response body for diagnostics","Distinguish httpError bodies from GraphQL JSON bodies via content sniffing"],"tags":["http","error-response","server"],"backgroundTag":"http-error-response","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}