package errors

import "google.golang.org/protobuf/internal/errors"

Package errors implements functions to manipulate errors.

Index

Variables

var Error = errors.New("protobuf error")

Error is a sentinel matching all errors produced by this package.

Functions

func InvalidUTF8

func InvalidUTF8(name string) error

func MismatchedSizeCalculation

func MismatchedSizeCalculation(calculated, measured int) error

func New

func New(f string, x ...any) error

New formats a string according to the format specifier and arguments and returns an error that has a "proto" prefix.

func RequiredNotSet

func RequiredNotSet(name string) error

func Wrap

func Wrap(err error, f string, x ...any) error

Wrap returns an error that has a "proto" prefix, the formatted string described by the format specifier and arguments, and a suffix of err. The error wraps err.

Types

type SizeMismatchError

type SizeMismatchError struct {
	Calculated, Measured int
}

func (*SizeMismatchError) Error

func (e *SizeMismatchError) Error() string

Source Files

errors.go

Version
v1.36.5 (latest)
Published
Feb 6, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
10 hours ago

Tools for package owners.