{"record":{"id":"12ca9a604d97d636","repo":"dapr/dapr","slug":"failed-to-marshal-response-as-json-w","errorCode":null,"errorMessage":"failed to marshal response as JSON: %w","messagePattern":"failed to marshal response as JSON: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/api/http/lock.go","lineNumber":89,"sourceCode":"\t)\n}\n\nfunc (a *api) onUnlockAlpha1() http.HandlerFunc {\n\treturn UniversalHTTPHandler(\n\t\ta.universal.UnlockAlpha1,\n\t\tUniversalHTTPHandlerOpts[*runtimev1pb.UnlockRequest, *runtimev1pb.UnlockResponse]{\n\t\t\tInModifier: func(r *http.Request, in *runtimev1pb.UnlockRequest) (*runtimev1pb.UnlockRequest, error) {\n\t\t\t\tin.StoreName = chi.URLParam(r, storeNameParam)\n\t\t\t\treturn in, nil\n\t\t\t},\n\t\t\tOutModifier: func(out *runtimev1pb.UnlockResponse) (any, error) {\n\t\t\t\t// Create the response manually because we want to report the status as a number and not a string\n\t\t\t\tb, err := protojson.MarshalOptions{\n\t\t\t\t\tEmitUnpopulated: true,\n\t\t\t\t\tUseEnumNumbers:  true,\n\t\t\t\t}.Marshal(out)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to marshal response as JSON: %w\", err)\n\t\t\t\t}\n\t\t\t\treturn UniversalHTTPRawResponse{\n\t\t\t\t\tBody:        b,\n\t\t\t\t\tContentType: jsonContentTypeHeader,\n\t\t\t\t}, nil\n\t\t\t},\n\t\t},\n\t)\n}\n","sourceCodeStart":71,"sourceCodeEnd":99,"githubUrl":"https://github.com/dapr/dapr/blob/74ad41702745709bb15fe2114ff693b8c59bc3cc/pkg/api/http/lock.go#L71-L99","documentation":"Error \"failed to marshal response as JSON: %w\" thrown in dapr/dapr.","triggerScenarios":"Thrown at pkg/api/http/lock.go:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"74ad41702745709bb15fe2114ff693b8c59bc3cc","analyzedAt":"2026-08-16T04:22:26.543Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}