package derrors

Import Path
	golang.org/x/pkgsite/internal/derrors (on go.dev)

Dependency Relation
	imports 5 packages, and imported by 28 packages

Involved Source Files Package derrors defines internal error values to categorize the different types error semantics we support.
Package-Level Type Names (only one, which is exported)
/* sort exporteds by: | */
StackError wraps an error and adds a stack trace. Stack []byte (*T) Error() string (*T) Unwrap() error *T : golang.org/x/xerrors.Wrapper *T : error func NewStackError(err error) *StackError
Package-Level Functions (total 10, all are exported)
Add adds context to the error. The result cannot be unwrapped to recover the original error. It does nothing when *errp == nil. Example: defer derrors.Add(&err, "copy(%s, %s)", src, dst) See Wrap for an equivalent function that allows the result to be unwrapped.
FromStatus generates an error according for the given status code. It uses the given format string and arguments to create the error string according to the fmt package. If format is the empty string, then the error corresponding to the code is returned unwrapped. If code is http.StatusOK, it returns nil.
NewStackError returns a StackError, capturing a stack trace.
Report uses the errorreporting API to report an error.
SetReportingClient sets an errorreporting client, for use by Report.
ToReprocessStatus returns the reprocess status code corresponding to the provided status.
ToStatus returns a status code corresponding to err.
Wrap adds context to the error and allows unwrapping the result to recover the original error. Example: defer derrors.Wrap(&err, "copy(%s, %s)", src, dst) See Add for an equivalent function that does not allow the result to be unwrapped.
WrapAndReport calls Wrap followed by Report.
WrapStack is like Wrap, but adds a stack trace if there isn't one already.
Package-Level Variables (total 27, in which 25 are exported)
AlternativeModule indicates that the path of the module zip file differs from the path specified in the go.mod file.
BadModule indicates a problem with a module.
Cleaned indicates that the module version was cleaned from the DB and shouldn't be reprocessed.
DBModuleInsertInvalid represents a module that was successfully fetched but could not be inserted due to invalid arguments to postgres.InsertModule.
Excluded indicates that the module is excluded. (See internal/postgres/excluded.go.)
HasIncompletePackages indicates a module containing packages that were processed with a 60x error code.
InvalidArgument indicates that the input into the request is invalid in some way (HTTP 400).
ModuleTooLarge indicates that the module is too large for us to process. This should be temporary: we should obtain sufficient resources to process any module, up to the max size allowed by the proxy.
NotFetched means that the proxy returned "not found" with the Disable-Module-Fetch header set. We don't know if the module really doesn't exist, or the proxy just didn't fetch it.
NotFound indicates that a requested entity was not found (HTTP 404).
PackageBadImportPath represents an error loading a package because its contents do not make up a valid package. This can happen, for example, if the .go files fail to parse or declare different package names. Go files were found in a directory, but the resulting import path is invalid.
PackageBuildContextNotSupported indicates that the build context for the package is not supported.
PackageDocumentationHTMLTooLarge indicates that the rendered documentation HTML size exceeded the specified limit for dochtml.RenderOptions.
PackageInvalidContents represents an error loading a package because its contents do not make up a valid package. This can happen, for example, if the .go files fail to parse or declare different package names.
PackageMaxFileSizeLimitExceeded indicates that the package contains a file that exceeds fetch.MaxFileSize.
PackageMaxImportsLimitExceeded indicates that the package has too many imports.
ProxyError is used to capture non-actionable server errors returned from the proxy.
ProxyTimedOut indicates that a request timed out when fetching from the Module Mirror.
ReprocessAlternativeModule indicates that the module to be reprocessed previously had a status of derrors.AlternativeModule.
ReprocessBadModule indicates that the module to be reprocessed previously had a status of derrors.BadModule.
ReprocessDBModuleInsertInvalid represents a module to be reprocessed that was successfully fetched but could not be inserted due to invalid arguments to postgres.InsertModule.
ReprocessHasIncompletePackages indicates that the module to be reprocessed previously had a status of 290.
ReprocessStatusOK indicates that the module to be reprocessed previously had a status of http.StatusOK.
SheddingLoad indicates that the server is overloaded and cannot process the module at this time.
Unknown indicates that the error has unknown semantics.