- Corrected JSON path for error code and activation URL extraction in client error handling. - Improved readability of the activation warning message with better spacing.
Unified · Split
| @@ -844,11 +844,11 @@ func (c *Client) CheckCloudAPIIsEnabled() (bool, error) { · 843 unmodified lines | ||
| 844 | 844 | if err.StatusCode == 403 { |
| 845 | 845 | errJSON := err.Error.Error() |
| 846 | 846 | // Check for a specific error code and extract the activation URL. |
| 847 | − if gjson.Get(errJSON, "error.code").Int() == 403 { | |
| 848 | − activationURL := gjson.Get(errJSON, "error.details.0.metadata.activationUrl").String() | |
| 847 | + if gjson.Get(errJSON, "0.error.code").Int() == 403 { | |
| 848 | + activationURL := gjson.Get(errJSON, "0.error.details.0.metadata.activationUrl").String() | |
| 849 | 849 | if activationURL != "" { |
| 850 | 850 | log.Warnf( |
| 851 | − "\n\nPlease activate your account with this url:\n\n%s\n And execute this command again:\n%s --login --project_id %s", | |
| 851 | + "\n\nPlease activate your account with this url:\n\n%s\n\n And execute this command again:\n%s --login --project_id %s", | |
| 852 | 852 | activationURL, |
| 853 | 853 | os.Args[0], |
| 854 | 854 | c.tokenStorage.ProjectID, |