package gerror
import "github.com/diamondburned/gotk4/pkg/core/gerror"
Index ¶
- func Copy(gerror unsafe.Pointer) error
- func New(err error) unsafe.Pointer
- func Take(gerror unsafe.Pointer) error
- type GError
- func (err *GError) Error() string
- func (err *GError) ErrorCode() int
- func (err *GError) Quark() uint32
- type GErrorCoder
Functions ¶
func Copy ¶
Copy return a new Go error from a *GError without freeing.
func New ¶
New creates a new *C.GError from the given error. The caller is responsible for freeing the error with g_error_free().
func Take ¶
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 (*GError) ErrorCode ¶
func (*GError) Quark ¶
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.
Source Files ¶
- Version
- v0.3.1 (latest)
- Published
- Jul 31, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 1 month ago –
Tools for package owners.