refactor: optimize third-party sdks
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package rainyunsdk
|
||||
package rainyun
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -67,7 +67,7 @@ func (c *Client) sendRequestWithResult(method string, path string, params interf
|
||||
if err := json.Unmarshal(resp.Body(), &result); err != nil {
|
||||
return fmt.Errorf("rainyun api error: failed to parse response: %w", err)
|
||||
} else if errcode := result.GetCode(); errcode/100 != 2 {
|
||||
return fmt.Errorf("rainyun api error: %d - %s", errcode, result.GetMessage())
|
||||
return fmt.Errorf("rainyun api error: code='%d', message='%s'", errcode, result.GetMessage())
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user