Skip to content

Commit

Permalink
[chore] add method parse error code into string
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Aug 29, 2024
1 parent 2ff7cbb commit ef112a7
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -13,6 +13,7 @@ type IError interface {
GetError() error
GetMessage() string
GetErrorCode() ErrorCode
GetStringErrorCode() string
GetParameters() map[string]interface{}
GetErrorMessages() string
GetListParameters() []interface{}
Expand Down
4 changes: 4 additions & 0 deletions vngcloud/sdk_error/sdk_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func (s *SdkError) GetErrorCode() ErrorCode {
return s.errorCode
}

func (s *SdkError) GetStringErrorCode() string {
return string(s.errorCode)
}

func (s *SdkError) GetParameters() map[string]interface{} {
return s.parameters
}
Expand Down

0 comments on commit ef112a7

Please sign in to comment.