mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 20:30:51 +08:00
Improve error logging and add user guidance for issue reporting
- Added fatal log in `login.go` for Cloud AI API enablement check failures, prompting users to report issues. - Enhanced error logging in `client.go` with warning messages directing users to copy and provide error details when creating issues.
This commit is contained in:
@@ -771,6 +771,7 @@ func (c *Client) CheckCloudAPIIsEnabled() (bool, error) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.Warnf("\n\nPlease copy this message and create an issue.\n\n%s\n\n", errJson)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
return false, err.Error
|
return false, err.Error
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ func DoLogin(cfg *config.Config, projectID string) {
|
|||||||
// If the check fails (returns false), the CheckCloudAPIIsEnabled function
|
// If the check fails (returns false), the CheckCloudAPIIsEnabled function
|
||||||
// will have already printed instructions, so we can just exit.
|
// will have already printed instructions, so we can just exit.
|
||||||
if !isChecked {
|
if !isChecked {
|
||||||
|
log.Fatal("Failed to check if Cloud AI API is enabled. If you encounter an error message, please create an issue.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user