errcode

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package errcode is the engine's namespace, and the error codes no one domain owns: what Dispatch can fail with whatever a command does. A code that belongs to a domain lives with it, beside the details it carries (query_invalid, with its QueryValidation, is the query package's). The engine package re-exports every code, and lists them all, by namespace, with engine.ErrorCodes.

The codes carry a scope but no status: the CLI has none, and a host assigns its own when it translates an engine error to one of its codes. Args the engine refuses are apperr's generic validation_failed, with a violation per arg by its canonical name. Anything else Dispatch returns is unclassified, and a host treats it as internal_server_error.

Index

Constants

This section is empty.

Variables

View Source
var (
	UnknownCommand     = apperr.DefinePublicCode(NS, "unknown_command", apperr.Client, "No such command.")
	DataPermsMissing   = apperr.DefinePublicCode(NS, "data_perms_missing", apperr.Client, "No data permissions were decided.")
	SidecarUnavailable = apperr.DefinePublicCode(NS, "sidecar_unavailable", apperr.Server, "A sidecar is unavailable.")
	// QueryFailed: canal-query could not run a query on its data source — the
	// data source unreachable, the credentials refused, the database rejecting
	// the query, or canal itself failing. canal-query scopes the first three all
	// "User" and does not say which, so they are not classified further yet.
	//
	// TODO: classify by canal's scope, re-decided here, never copied: "User"
	// splits into a query the database rejects (the caller's: query_invalid)
	// and a data source it cannot reach or log in to (not the caller's);
	// "Server" is a dependency failing; "Client" is a request the engine built
	// wrong — its own bug, and already left unclassified.
	QueryFailed = apperr.DefinePublicCode(NS, "query_failed", apperr.Server, "The query failed to run on its data source.")
	// DataPermsUnenforceable: the caller's data permissions are restricted, and
	// the query cannot apply them — raw SQL, which no restriction is compiled
	// into. The host decided the caller may run it; it states that with
	// Unrestricted.
	DataPermsUnenforceable = apperr.DefinePublicCode(NS, "data_perms_unenforceable", apperr.Client,
		"These data permissions cannot be applied to this query.")
	// ExportsUnavailable: the server stores no exports (it provides no
	// command.ExportStore), so an export cannot be made here.
	ExportsUnavailable = apperr.DefinePublicCode(NS, "exports_unavailable", apperr.Server, "This server cannot make exports.")
	// LocalRepoNotAllowed: an invocation on a local repo from a host that did not
	// allow local repos (CommandContext.AllowLocalRepo). A host mistake, as
	// DataPermsMissing is: a platform serving managed repos never builds a local
	// one, and one that serves a directory says so.
	LocalRepoNotAllowed = apperr.DefinePublicCode(NS, "local_repo_not_allowed", apperr.Client, "This host does not allow local repos.")
)
View Source
var NS = apperr.DefineNamespace("anfra")

NS is the engine's namespace, for its codes and its steps.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL