Documentation
¶
Overview ¶
Package exitcode defines cover100's process exit codes and the error type that carries one.
The vocabulary is deliberately small and stable: scripts branch on these numbers, so a new meaning never reuses an existing number.
Index ¶
- Constants
- type Error
- func InvalidArgsError(msg string) *Error
- func InvalidArgsErrorf(format string, args ...any) *Error
- func New(code int, msg string) *Error
- func Newf(code int, format string, args ...any) *Error
- func NotFoundError(msg string) *Error
- func NotFoundErrorCause(msg string, cause error) *Error
- func NotFoundErrorf(format string, args ...any) *Error
- func UnexpectedError(msg string) *Error
- func UnexpectedErrorCause(msg string, cause error) *Error
- func UnexpectedErrorf(format string, args ...any) *Error
- func Wrap(code int, msg string, cause error) *Error
Constants ¶
const ( // Success means the report was written. Collection warnings do not change // this: a run that salvaged a partial Go profile still produced a report. Success = 0 // InvalidArgs means a flag value or argument was missing or malformed. InvalidArgs = 2 // NotFound means the scan path does not exist, is not a directory, or // contains no Go module and no Node package. NotFound = 3 // Unexpected is the catch-all for runtime failures: an unwritable report // path, a port that could not be bound, a panicking dependency. Unexpected = 10 )
Standard exit codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error carries a process exit code alongside a human-readable message. It satisfies both the error interface and the ExitCode() convention the top-level runner checks.
func InvalidArgsError ¶
InvalidArgsError returns an exit-code-2 error.
func InvalidArgsErrorf ¶
InvalidArgsErrorf returns an exit-code-2 error with a formatted message.
func NotFoundError ¶
NotFoundError returns an exit-code-3 error.
func NotFoundErrorCause ¶
NotFoundErrorCause maps a lookup or scan failure to exit 3 while keeping the underlying cause wrapped for errors.Is/errors.As.
func NotFoundErrorf ¶
NotFoundErrorf returns an exit-code-3 error with a formatted message.
func UnexpectedError ¶
UnexpectedError returns an exit-code-10 error.
func UnexpectedErrorCause ¶
UnexpectedErrorCause maps a runtime cause to exit 10, keeping it wrapped.
func UnexpectedErrorf ¶
UnexpectedErrorf returns an exit-code-10 error with a formatted message.