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