utils

package
v0.0.0-...-ad2634f Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSafeError

func NewSafeError(err error, msg string) error

NewSafeError returns a new SafeError.

func NewSafeErrorf

func NewSafeErrorf(err error, format string, args ...interface{}) error

NewSafeErrorf returns a new SafeError with formatting.

Types

type SafeError

type SafeError struct {
	Err error
	Msg string
}

SafeError wraps an error which may contain sensitive information, allowing it to be matched without exposing sensitive details when logging the error.

func (*SafeError) Error

func (s *SafeError) Error() string

Error returns the safe error message.

func (*SafeError) UnsafeError

func (s *SafeError) UnsafeError() string

UnsafeError returns the full error message, which may contain sensitive information.

func (*SafeError) Unwrap

func (s *SafeError) Unwrap() error

Unwrap returns the wrapped error, which may contain sensitive information.

Jump to

Keyboard shortcuts

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