Skip to content

Commit

Permalink
[feat] enhance logs handler base feature
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed May 30, 2024
1 parent 0a5548a commit 9763e11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions vngcloud/sdk_error/isdk_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ISdkError interface {
GetErrorCode() ErrorCode
GetParameters() map[string]interface{}
GetErrorMessages() string
GetListParameters() []interface{}
}

type IErrorRespone interface {
Expand Down
13 changes: 13 additions & 0 deletions vngcloud/sdk_error/sdk_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,16 @@ func (s *SdkError) GetErrorMessages() string {

return lfmt.Sprintf("%s: %s", s.message, s.error.Error())
}

func (s *SdkError) GetListParameters() []interface{} {
var result []interface{}
if s.parameters == nil {
return result
}

for key, val := range s.parameters {
result = append(result, key, val)
}

return result
}

0 comments on commit 9763e11

Please sign in to comment.