Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d4007344d |
+2
-8
@@ -41,15 +41,11 @@ type CastError struct {
|
||||
Message *string
|
||||
}
|
||||
|
||||
func TeaSDKError(err error) *tea.SDKError {
|
||||
func TeaSDKError(err error) error {
|
||||
if(err == nil) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if oe, ok := err.(*tea.SDKError); ok {
|
||||
return oe
|
||||
}
|
||||
|
||||
if te, ok := err.(*SDKError); ok {
|
||||
return tea.NewSDKError(map[string]interface{}{
|
||||
"code": StringValue(te.Code),
|
||||
@@ -76,9 +72,7 @@ func TeaSDKError(err error) *tea.SDKError {
|
||||
})
|
||||
}
|
||||
|
||||
return tea.NewSDKError(map[string]interface{}{
|
||||
"message": err.Error(),
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// NewSDKError is used for shortly create SDKError object
|
||||
|
||||
Reference in New Issue
Block a user