errorhandler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorHandler

type ErrorHandler interface {
	HandleError() connect.UnaryInterceptorFunc
}

ErrorHandler interface

type Interceptor

type Interceptor struct {
	// contains filtered or unexported fields
}

Interceptor is the interceptor for the error handler

func NewInterceptor

func NewInterceptor(modeFlag *goflagsmode.Flag, logger *slog.Logger) (*Interceptor, error)

NewInterceptor creates a new error handler interceptor

Parameters:

  • modeFlag: the application mode flag
  • logger: the logger to use (can be nil)

Returns:

  • *Interceptor: the interceptor
  • error: if there was an error creating the interceptor

func (Interceptor) HandleError

func (i Interceptor) HandleError() connect.UnaryInterceptorFunc

HandleError returns the error handler interceptor

Returns:

  • connect.UnaryInterceptorFunc: the error handler interceptor

Jump to

Keyboard shortcuts

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