{"record":{"id":"7a57e45c2da826de","repo":"glanceapp/glance","slug":"marshaling-s-v","errorCode":null,"errorMessage":"marshaling %s: %v","messagePattern":"marshaling (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-custom-api.go","lineNumber":119,"sourceCode":"}\n\nfunc (o *customAPIOptions) FloatOr(key string, defaultValue float64) float64 {\n\treturn customAPIGetOptionOrDefault(*o, key, defaultValue)\n}\n\nfunc (o *customAPIOptions) BoolOr(key string, defaultValue bool) bool {\n\treturn customAPIGetOptionOrDefault(*o, key, defaultValue)\n}\n\nfunc (o *customAPIOptions) JSON(key string) string {\n\tvalue, exists := (*o)[key]\n\tif !exists {\n\t\tpanic(fmt.Sprintf(\"key %q does not exist in options\", key))\n\t}\n\n\tencoded, err := json.Marshal(value)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"marshaling %s: %v\", key, err))\n\t}\n\n\treturn string(encoded)\n}\n\nfunc customAPIGetOptionOrDefault[T any](o customAPIOptions, key string, defaultValue T) T {\n\tif value, exists := o[key]; exists {\n\t\tif typedValue, ok := value.(T); ok {\n\t\t\treturn typedValue\n\t\t}\n\t}\n\treturn defaultValue\n}\n\nfunc (req *CustomAPIRequest) initialize() error {\n\tif req == nil || req.URL == \"\" {\n\t\treturn nil\n\t}","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-custom-api.go#L101-L137","documentation":"Error \"marshaling %s: %v\" thrown in glanceapp/glance.","triggerScenarios":"Occurs when a value stored in the custom-api options map cannot be marshaled to JSON, e.g. a channel, function, or cyclic structure.","commonSituations":"Passing a non-JSON-serializable decoded response value into the options map used by the template.","solutions":["Ensure the option value being marshaled is JSON-serializable (no channels, functions, or cyclic structures).","Pass plain values (strings, numbers, booleans, maps, slices) in the custom-api request options."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}