()
| 160 | } |
| 161 | |
| 162 | func (e *NewAPIError) MaskSensitiveErrorWithStatusCode() string { |
| 163 | if e == nil { |
| 164 | return "" |
| 165 | } |
| 166 | msg := e.MaskSensitiveError() |
| 167 | if e.StatusCode == 0 { |
| 168 | return msg |
| 169 | } |
| 170 | if msg == "" { |
| 171 | return fmt.Sprintf("status_code=%d", e.StatusCode) |
| 172 | } |
| 173 | return fmt.Sprintf("status_code=%d, %s", e.StatusCode, msg) |
| 174 | } |
| 175 | |
| 176 | func (e *NewAPIError) SetMessage(message string) { |
| 177 | e.Err = errors.New(message) |
no test coverage detected