MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / ToOpenAIError

Method ToOpenAIError

types/error.go:105–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103}
104
105func (e *NewAPIError) ToOpenAIError() OpenAIError {
106 switch e.ErrorType {
107 case ErrorTypeOpenAIError:
108 return e.RelayError.(OpenAIError)
109 case ErrorTypeClaudeError:
110 claudeError := e.RelayError.(ClaudeError)
111 return OpenAIError{
112 Message: e.Error(),
113 Type: claudeError.Type,
114 Param: "",
115 Code: e.errorCode,
116 }
117 default:
118 return OpenAIError{
119 Message: e.Error(),
120 Type: string(e.ErrorType),
121 Param: "",
122 Code: e.errorCode,
123 }
124 }
125}
126
127func (e *NewAPIError) ToClaudeError() ClaudeError {
128 switch e.ErrorType {

Callers 4

PlaygroundFunction · 0.95
RelayFunction · 0.95
WssRelayFunction · 0.95
ShouldDisableChannelFunction · 0.80

Calls 1

ErrorMethod · 0.95

Tested by

no test coverage detected