Monorepo for Tangled — https://tangled.org

appview/oauth: improve logging for default knot failures

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 35ec6890 1b314963

verified
+5 -1
+5 -1
appview/oauth/handler.go
··· 346 346 defer resp.Body.Close() 347 347 348 348 if resp.StatusCode != http.StatusOK { 349 - return fmt.Errorf("failed to add user to default service: HTTP %d", resp.StatusCode) 349 + var errorResponse map[string]any 350 + if err := json.NewDecoder(resp.Body).Decode(&errorResponse); err != nil { 351 + return fmt.Errorf("failed to add user to default service: HTTP %d (failed to decode error response: %w)", resp.StatusCode, err) 352 + } 353 + return fmt.Errorf("failed to add user to default service: HTTP %d, response: %v", resp.StatusCode, errorResponse) 350 354 } 351 355 352 356 return nil