errorutil

package
v0.74.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 1 Imported by: 0

README

errorutil Package

The errorutil package provides shared helpers for classifying and inspecting errors returned by the GitHub API and gh CLI.

Overview

This package currently exposes focused helpers for identifying common error categories used across pkg/cli and pkg/parser, including "not found" (404) responses.

Public API

Functions
Function Signature Description
IsNotFoundError func(err error) bool Returns true when err indicates a "not found" condition by matching case-insensitive 404 or not found text; returns false for nil and non-matching errors

Usage Examples

import "github.com/github/gh-aw/pkg/errorutil"

if errorutil.IsNotFoundError(err) {
    // Handle missing resource path
}

Dependencies

None.

Design Notes

  • IsNotFoundError intentionally accepts multiple message formats to cover errors produced by GitHub API responses, gh CLI output, and go-gh wrappers.

This specification is automatically maintained by the spec-extractor workflow.

Documentation

Overview

Package errorutil provides shared helpers for classifying and inspecting errors returned by the GitHub API and gh CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError reports whether err represents an HTTP 404 / "not found" response. It returns false when err is nil. The check is case-insensitive and matches both the numeric literal "404" and the phrase "not found", which covers all known forms returned by the GitHub API, the gh CLI, and the go-gh library.

Types

This section is empty.

Jump to

Keyboard shortcuts

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