gerror

package
v0.0.0-...-aefa52a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MPL-2.0, ISC Imports: 6 Imported by: 0

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