package serrors
import "golang.org/x/pkgsite/internal/frontend/serrors"
serrors contains error types used by the server
Index ¶
- Variables
- func DatasourceNotSupportedError() error
- func InvalidVersionError(fullPath, requestedVersion string) error
- type ServerError
Variables ¶
var ErrUnitNotFoundWithoutFetch = &ServerError{ Status: http.StatusNotFound, Epage: &page.ErrorPage{ MessageTemplate: template.MakeTrustedTemplate("" /* 251 byte string literal not displayed */, ), MessageData: struct{ StatusText string }{http.StatusText(http.StatusNotFound)}, }, }
errUnitNotFoundWithoutFetch returns a 404 with instructions to the user on how to manually fetch the package. No fetch button is provided. This is used for very large modules or modules that previously 500ed.
Functions ¶
func DatasourceNotSupportedError ¶
func DatasourceNotSupportedError() error
func InvalidVersionError ¶
Types ¶
type ServerError ¶
type ServerError struct { Status int // HTTP status code ResponseText string // Response text to the user Epage *page.ErrorPage Err error // wrapped error }
ServerError is a type of error that can be dosplayed by the server.
func (*ServerError) Error ¶
func (s *ServerError) Error() string
func (*ServerError) Unwrap ¶
func (s *ServerError) Unwrap() error
Source Files ¶
serrors.go
- Version
- v0.0.0-20250218150137-224a1368cf02 (latest)
- Published
- Feb 18, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 2 months ago –
Tools for package owners.