(err error, errorCode ErrorCode)
| 143 | } |
| 144 | |
| 145 | func NewError(err error, errorCode ErrorCode) *NewAPIError { |
| 146 | return &NewAPIError{ |
| 147 | Err: err, |
| 148 | RelayError: nil, |
| 149 | ErrorType: ErrorTypeNewAPIError, |
| 150 | StatusCode: http.StatusInternalServerError, |
| 151 | errorCode: errorCode, |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | func NewOpenAIError(err error, errorCode ErrorCode, statusCode int) *NewAPIError { |
| 156 | openaiError := OpenAIError{ |
no outgoing calls
no test coverage detected