{"record":{"id":"d04e29dcf32a0ed1","repo":"wtfutil/wtf","slug":"you-specified-wrong-region-possible-options-are-o","errorCode":null,"errorMessage":"you specified wrong region. Possible options are only 'us' and 'eu'","messagePattern":"you specified wrong region\\. Possible options are only 'us' and 'eu'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/opsgenie/client.go","lineNumber":48,"sourceCode":"}\n\n/* -------------------- Exported Functions -------------------- */\n\nfunc (widget *Widget) Fetch(scheduleIdentifierType string, schedules []string) ([]*OnCallResponse, error) {\n\tagregatedResponses := []*OnCallResponse{}\n\n\tif regionURL, regionErr := opsGenieAPIUrl[widget.settings.region]; regionErr {\n\t\tfor _, sched := range schedules {\n\t\t\tscheduleURL := fmt.Sprintf(\"%s/v2/schedules/%s/on-calls?scheduleIdentifierType=%s&flat=true\", regionURL, sched, scheduleIdentifierType)\n\t\t\tresponse, err := opsGenieRequest(scheduleURL, widget.settings.apiKey)\n\t\t\tagregatedResponses = append(agregatedResponses, response)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn agregatedResponses, nil\n\t} else {\n\t\treturn nil, fmt.Errorf(\"you specified wrong region. Possible options are only 'us' and 'eu'\")\n\t}\n}\n\n/* -------------------- Unexported Functions -------------------- */\n\nfunc opsGenieRequest(url string, apiKey string) (*OnCallResponse, error) {\n\treq, err := http.NewRequest(\"GET\", url, http.NoBody)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"GenieKey %s\", apiKey))\n\n\tclient := &http.Client{}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/opsgenie/client.go#L30-L66","documentation":"Raised in the OpsGenie widget's Fetch when the configured region is not a key in opsGenieAPIUrl — i.e. settings.region is anything other than 'us' or 'eu'. Without a valid region the widget cannot build the API base URL, so fetching on-call schedules aborts. Note the message is returned when the map lookup succeeds is false, meaning region was misspelled or empty.","triggerScenarios":"Thrown at modules/opsgenie/client.go:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set region in the OpsGenie widget config to exactly 'us' or 'eu'","Check for typos, capitalization, or whitespace in the region value","If region is omitted in config, add it explicitly rather than relying on defaults"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}