This commit is contained in:
src committed 2026-08-26 17:36:55 +03:00
commit 064c17cd42
292 files changed
+43992

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
// Code generated by internal codegen utility; DO NOT EDIT.
package core
import (
"fmt"
"net/http"
)
// HTTPError is returned for a non-2xx HTTP response.
type HTTPError struct {
StatusCode int
Header http.Header
Body []byte
}
func (e *HTTPError) Error() string {
status := fmt.Sprintf("HTTP %d", e.StatusCode)
if statusText := http.StatusText(e.StatusCode); statusText != "" {
status += " " + statusText
}
if len(e.Body) == 0 {
return status
}
return status + ": " + string(e.Body)
}
// BackendError is returned when the backend reports an error in an otherwise
// successful HTTP response.
type BackendError struct {
Code int64
Message string
}
func (e *BackendError) Error() string {
return fmt.Sprintf("code: %v, message: %v", e.Code, e.Message)
}