Documentation
¶
Overview ¶
Package devreport is what dev mode (BACKD_DEV) says when a config doesn't load: the problems it holds, each with where it is, the tool's output and what to do, for the log and for the dev landing page and API answers.
Index ¶
Constants ¶
const ( Config = "config" // a file of CONFIG_DIR, or the config as a whole Rules = "rules" // a collection's rules Build = "build" // bundling a database's functions )
Problem kinds: what failed when a config didn't load in dev mode.
const ConfigPrefix = "invalid config:\n"
ConfigPrefix starts the error of a config that does not load.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildError ¶
type BuildError struct{ Err error }
BuildError marks an error of bundling the functions, so its report has kind build.
func (BuildError) Error ¶
func (e BuildError) Error() string
func (BuildError) Unwrap ¶
func (e BuildError) Unwrap() error
type Problem ¶
type Problem struct {
Kind string `json:"kind"`
File string `json:"file,omitempty"` // relative to CONFIG_DIR, when known
Line int `json:"line,omitempty"` // when known
Message string `json:"message"`
Output string `json:"output,omitempty"` // the tool's output as it is (Deno's, for a build)
Hint string `json:"hint"`
}
Problem is one reason a config didn't load, as dev mode reports it: in one log record and on the API root.
func Of ¶
Of splits an error of loading the config into the problems it holds: one per file error of the config (errors.Join), and one for a build, with Deno's output.