glanceapp/glance · error

initializing request: %v

Error message

initializing request: %v

What it means

Error "initializing request: %v" thrown in glanceapp/glance.

Source

Thrown at internal/glance/widget-custom-api.go:665

			req.Headers[key] = value
			return req
		},
		"withParameter": func(key, value string, req *CustomAPIRequest) *CustomAPIRequest {
			if req.Parameters == nil {
				req.Parameters = make(queryParametersField)
			}
			req.Parameters[key] = append(req.Parameters[key], value)
			return req
		},
		"withStringBody": func(body string, req *CustomAPIRequest) *CustomAPIRequest {
			req.Body = body
			req.BodyType = "string"
			return req
		},
		"getResponse": func(req *CustomAPIRequest) *customAPIResponseData {
			err := req.initialize()
			if err != nil {
				panic(fmt.Sprintf("initializing request: %v", err))
			}

			data, err := fetchCustomAPIResponse(context.Background(), req)
			if err != nil {
				slog.Error("Could not fetch response within custom API template", "error", err)
				return &customAPIResponseData{
					JSON: decoratedGJSONResult{gjson.Result{}},
					Response: &http.Response{
						Status: err.Error(),
					},
				}
			}

			return data
		},
	}

	for key, value := range globalTemplateFunctions {

View on GitHub (pinned to 91324e8de7)

Solutions

  1. Fix the request built inside the custom-api template via 'newRequest'/'withURL'/etc.: provide a valid URL and valid headers/parameters.
  2. Check the underlying initialization error included in the message (e.g. URL parsing) and correct the corresponding template call.

When it happens

Trigger: Occurs when building an HTTP request for the custom-api widget fails, e.g. an invalid URL, invalid header value, or unsupported method.

Common situations: A malformed URL in the widget config, headers containing illegal characters, or a template producing an invalid URL at runtime.


AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15). Data as JSON: /api/errors/ceacf1e27214344e. Report an issue: GitHub.