apierr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package apierr answers, in one place, which HTTP status a failed job deserves.

It exists so that thirty-odd handlers do not each decide for themselves. They used to, by matching on the words a provider happened to use, and the answers drifted: one endpoint checked for "does not exist" while its neighbour checked "not found", a third checked neither and answered 500 where its own specification promised 404, and two checked for a phrase the code they call can never produce.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMissing

func IsMissing(
	err error,
) bool

IsMissing reports whether a failed job means the thing the endpoint addresses is not there as far as osapi is concerned, which the API answers with 404.

Three causes qualify, and they stay distinct behind this one question because they are not the same thing to an operator: the host has no such user, the file is there but osapi does not manage it, and the program the operation needs is not installed. An endpoint that ever needs to answer them differently asks errors.Is directly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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