Sentinel
1.x
Docs/Sentinel/Error Handling
Open

Reading1 min
Updated31 Jul 2026
Sourcev1/concepts/errors.mdx

Sentinel defines sentinel errors in the root sentinel package. All errors are created with errors.New and can be checked with errors.Is.

Store errors01

ErrorDescription
ErrNoStoreNo store was configured on the engine
ErrStoreClosedThe store has been closed
ErrMigrationFailedDatabase migration failed

Not-found errors02

ErrorDescription
ErrSuiteNotFoundSuite with the given ID does not exist
ErrCaseNotFoundCase with the given ID does not exist
ErrRunNotFoundRun with the given ID does not exist
ErrBaselineNotFoundBaseline with the given ID does not exist
ErrPromptVersionNotFoundPrompt version with the given ID does not exist

Conflict errors03

ErrorDescription
ErrSuiteAlreadyExistsA suite with the same name already exists in this app

State errors04

ErrorDescription
ErrInvalidStateInvalid state transition
ErrEmptyInputEmpty input provided

Evaluation errors05

ErrorDescription
ErrNoTargetNo target configured for the evaluation
ErrNoScorersNo scorers configured for the case

Error wrapping06

Store implementations wrap these sentinel errors with additional context:

return fmt.Errorf("postgres: get suite %s: %w", suiteID, sentinel.ErrSuiteNotFound)

Check errors using errors.Is:

s, err := eng.GetSuite(ctx, suiteID)
if errors.Is(err, sentinel.ErrSuiteNotFound) {
    // handle not found
}

API error mapping07

The HTTP API maps sentinel errors to HTTP status codes:

Sentinel errorHTTP status
ErrSuiteNotFound, ErrCaseNotFound, etc.404 Not Found
ErrSuiteAlreadyExists409 Conflict
ErrInvalidState, ErrEmptyInput400 Bad Request
ErrNoStore500 Internal Server Error