T-error
Gnome::Glib::T-error
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
Class initialization
new
Initialization of a type class is simple and only needed when the standalone functions are used.
method new ( )
#------------------------------------------------------------------------------- #--[Record Structure Documentation]--------------------------------------------- #-------------------------------------------------------------------------------
Record N-Error
class N-Error:auth<github:MARTIMM>:api<2> is export is repr('CStruct') {
has GQuark $.domain;
has gint $.code;
has Str $.message;
}
domain; error domain, e.g.
G_FILE_ERRORcode; error code, e.g.
G_FILE_ERROR_NOENTmessage; human-readable informative error message
#------------------------------------------------------------------------------- #--[Callback Functions]--------------------------------------------------------- #-------------------------------------------------------------------------------
Callback Functions
ErrorClearFunc
Signature
:( N-Object $error )
error; extended error to clear
ErrorInitFunc
Signature
:( N-Object $error )
error; extended error
ErrorCopyFunc
Signature
:( N-Object $src-error, N-Object $dest-error )
src-error; source extended error
dest-error; destination extended error
#------------------------------------------------------------------------------- #--[Standalone Functions]------------------------------------------------------- #-------------------------------------------------------------------------------
Standalone Functions
#-------------------------------------------------------------------------------
clear-error
If $err or * $err is undefined, does nothing. Otherwise,
calls .free() on * $err and sets * $err to undefined.
method clear-error ( CArray[N-Error] $err )
$err; Error object. When defined, an error can be returned when there is one. Use
Pointerwhen you want to ignore the error. .
#-------------------------------------------------------------------------------
prefix-error This function is not yet available
Formats a string according to $format and prefix it to an existing
error message. If $err is undefined (ie: no error variable) then do
nothing.
If * $err is undefined (ie: an error variable is present but there is no
error condition) then also do nothing.
method prefix-error ( N-Object $err, Str $format, ⦠)
$err; (transfer ownership: full) a return location for a Gnome::Glib::T-error
$format; printf()-style format string.
ā¦; ā¦. Note that each argument must be specified as a type followed by its value!
#-------------------------------------------------------------------------------
prefix-error-literal
Prefixes $prefix to an existing error message. If $err or * $err is
undefined (i.e.: no error variable) then do nothing.
method prefix-error-literal ( N-Object $err, Str $prefix )
$err; a return location for a Gnome::Glib::T-error, or undefined
$prefix; string to prefix
$errwith.
#-------------------------------------------------------------------------------
propagate-error
If $dest is undefined, free $src; otherwise, moves $src into * $dest.
The error variable $dest points to must be undefined.
$src must be non-undefined.
Note that $src is no longer valid after this call. If you want
to keep using the same GError*, you need to set it to undefined
after calling this function on it.
method propagate-error ( N-Object $dest, N-Object $src )
$dest; (transfer ownership: full) error return location
$src; (transfer ownership: full) error to move into the return location
#-------------------------------------------------------------------------------
propagate-prefixed-error This function is not yet available
If $dest is undefined, free $src; otherwise, moves $src into * $dest.
* $dest must be undefined. After the move, add a prefix as with
g_prefix_error().
method propagate-prefixed-error ( N-Object $dest, N-Object $src, Str $format, ⦠)
$dest; error return location
$src; error to move into the return location
$format; printf()-style format string.
ā¦; ā¦. Note that each argument must be specified as a type followed by its value!
#-------------------------------------------------------------------------------
set-error This function is not yet available
Does nothing if $err is undefined; if $err is non-undefined, then * $err
must be undefined. A new Gnome::Glib::T-error is created and assigned to * $err.
method set-error ( N-Object $err, UInt $domain, Int() $code, Str $format, ⦠)
$err; (transfer ownership: full) a return location for a Gnome::Glib::T-error
$domain; error domain.
$code; error code.
$format; printf()-style format.
ā¦; ā¦. Note that each argument must be specified as a type followed by its value!
#-------------------------------------------------------------------------------
set-error-literal
Does nothing if $err is undefined; if $err is non-undefined, then * $err
must be undefined. A new Gnome::Glib::T-error is created and assigned to * $err.
Unlike g_set_error(), $message is not a printf()-style format string.
Use this function if $message contains text you don't have control over,
that could include printf() escape sequences.
method set-error-literal ( N-Object $err, UInt $domain, Int() $code, Str $message )
$err; (transfer ownership: full) a return location for a Gnome::Glib::T-error
$domain; error domain.
$code; error code.
$message; error message.