gerror

package
v0.0.0-...-2cf96cb Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: ISC Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(gerror unsafe.Pointer) error

Copy return a new Go error from a *GError without freeing.

func New

func New(err error) unsafe.Pointer

New creates a new *C.GError from the given error. The caller is responsible for freeing the error with g_error_free().

func Take

func Take(gerror unsafe.Pointer) error

Take returns a new Go error from a *GError and frees the *GError. If the *GError is nil, then a nil error is returned.

Types

type GError

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

GError is converted from a C.GError to implement Go's error interface.

func (*GError) Error

func (err *GError) Error() string

func (*GError) ErrorCode

func (err *GError) ErrorCode() int

func (*GError) Quark

func (err *GError) Quark() uint32

Quark returns the internal quark for the error. Callers that want this quark must manually type assert using their own interface.

type GErrorCoder

type GErrorCoder interface {
	GErrorCode() int
}

GErrorCoder is an interface that returns a GError code. Errors may optionally implement this interface to override the default error code.

Jump to

Keyboard shortcuts

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