{"record":{"id":"9bada4bd782f66e6","repo":"hasura/graphql-engine","slug":"data-error-s","errorCode":null,"errorMessage":"data error: %s","messagePattern":"data error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/migrate/database/hasuradb/types.go","lineNumber":195,"sourceCode":"// NewHasuraError - returns error based on data and isCmd.\nfunc NewHasuraError(data []byte, isCmd bool) error {\n\tvar op errors.Op = \"hasuradb.NewHasuraError\"\n\n\tswitch isCmd {\n\tcase true:\n\t\tvar herror HasuraError\n\n\t\terr := json.Unmarshal(data, &herror)\n\t\tif err != nil {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\"failed parsing json: %w; response from API: %s\", err, string(data)),\n\t\t\t)\n\t\t}\n\n\t\treturn herror\n\tdefault:\n\t\treturn errors.E(op, fmt.Errorf(\"data error: %s\", string(data)))\n\t}\n}\n","sourceCodeStart":177,"sourceCodeEnd":198,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/migrate/database/hasuradb/types.go#L177-L198","documentation":"NewHasuraError's default branch: the response data is an error of an unrecognized shape (neither a parseable HasuraError JSON object nor a handled case), so the raw data is surfaced verbatim.","triggerScenarios":"An API response error payload that doesn't match any known structure, e.g. a JSON string error, empty body with error status, or a new server error format.","commonSituations":"Server/CLI version skew where the server emits a newer error format, or intermediate proxies altering responses.","solutions":["Inspect the raw data in the message to identify the producer","Align CLI and server versions","Check for proxies/firewalls mangling responses"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil {\n    log.Printf(\"raw API error data: %v\", err)\n    // parse raw payload from message to identify origin\n}","preventionTips":["Keep CLI and server versions compatible","Avoid middleware that rewrites response bodies"],"tags":["hasura","api","unknown-format"],"backgroundTag":"unexpected-api-response-format","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}