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