apperrors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package apperrors provides common static errors used throughout the application.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPageIDRequired is returned when a page ID or URL is required but not provided.
	ErrPageIDRequired = errors.New("page ID or URL required")

	// ErrNotLocalStore is returned when an operation requires a LocalStore but a different store type was provided.
	ErrNotLocalStore = errors.New("store is not a LocalStore")

	// ErrRemoteNotConfigured is returned when a git remote operation is attempted but no remote is configured.
	ErrRemoteNotConfigured = errors.New("no remote configured")

	// ErrRemoteNotConfiguredSetURL is returned when push/pull is attempted without NTN_GIT_URL set.
	ErrRemoteNotConfiguredSetURL = errors.New("remote not configured (set NTN_GIT_URL)")

	// ErrNotionTokenRequired is returned when a Notion token is required but not provided.
	ErrNotionTokenRequired = errors.New("notion token required (--token or NOTION_TOKEN env var)")

	// ErrHTTPSPasswordRequired is returned when HTTPS git URL is used without NTN_GIT_PASS.
	ErrHTTPSPasswordRequired = errors.New("NTN_GIT_PASS required for HTTPS URLs")

	// ErrMaxRetriesExceeded is returned when the maximum number of retries is exceeded.
	ErrMaxRetriesExceeded = errors.New("max retries exceeded")

	// ErrEmptyInput is returned when an empty input is provided.
	ErrEmptyInput = errors.New("empty input")

	// ErrInvalidPageIDFormat is returned when a page ID has an invalid format.
	ErrInvalidPageIDFormat = errors.New("invalid page ID format")

	// ErrUnexpectedBlockParentType is returned when a block has an unexpected parent type.
	ErrUnexpectedBlockParentType = errors.New("unexpected block parent type")

	// ErrMaxDepthExceeded is returned when the maximum depth is exceeded while resolving block parent chain.
	ErrMaxDepthExceeded = errors.New("max depth exceeded while resolving block parent chain")

	// ErrNoFrontmatter is returned when no frontmatter is found in a markdown file.
	ErrNoFrontmatter = errors.New("no frontmatter found")

	// ErrFrontmatterNotClosed is returned when frontmatter is not properly closed.
	ErrFrontmatterNotClosed = errors.New("frontmatter not closed")

	// ErrNoPreviousPullTime is returned when no previous pull time is found and --since flag is not specified.
	ErrNoPreviousPullTime = errors.New("no previous pull time found, please use --since flag to specify duration")

	// ErrFolderNameEmpty is returned when a folder name is empty.
	ErrFolderNameEmpty = errors.New("folder name cannot be empty")

	// ErrFolderNameInvalid is returned when a folder name contains invalid characters.
	ErrFolderNameInvalid = errors.New("folder name must contain only lowercase letters, numbers, and hyphens")

	// ErrTransactionCommitted is returned when attempting to use a transaction that has already been committed.
	ErrTransactionCommitted = errors.New("transaction already committed")
)

Common static errors used throughout the application.

Functions

This section is empty.

Types

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
}

HTTPError represents an HTTP error with a status code.

func NewHTTPError

func NewHTTPError(statusCode int, body string) *HTTPError

NewHTTPError creates a new HTTPError.

func (*HTTPError) Error

func (e *HTTPError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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