Documentation ¶
Overview ¶
serrors contains error types used by the server
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnitNotFoundWithoutFetch = &ServerError{ Status: http.StatusNotFound, Epage: &page.ErrorPage{ MessageTemplate: template.MakeTrustedTemplate(` <h3 class="Error-message">{{.StatusText}}</h3> <p class="Error-message">Check that you entered the URL correctly or try fetching it following the <a href="/about#adding-a-package">instructions here</a>.</p>`), 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
Click to show internal directories.
Click to hide internal directories.