About my projects, examples and tutorials
NO_TITLE

NO_TITLE

Gnome::Glib::T-error§

Class initialization§

new§

Initialization of a type class is simple and only needed when the standalone functions are used.

method new ( )
Code

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;
}
Code
  • domain; error domain, e.g. G_FILE_ERROR
  • code; error code, e.g. G_FILE_ERROR_NOENT
  • message; human-readable informative error message

Callback Functions§

ErrorClearFunc§

Signature§

:(  N-Object $error  )
Code
  • error; extended error to clear

ErrorInitFunc§

Signature§

:(  N-Object $error  )
Code
  • error; extended error

ErrorCopyFunc§

Signature§

:(  N-Object $src-error, N-Object $dest-error  )
Code
  • src-error; source extended error
  • dest-error; destination extended error

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 )
Code
  • $err; Error object. When defined, an error can be returned when there is one. Use Pointer when 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, … )
Code
  • $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 )
Code
  • $err; a return location for a Gnome::Glib::T-error, or undefined
  • $prefix; string to prefix $err with.

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 )
Code
  • $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, … )
Code
  • $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, … )
Code
  • $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 )
Code
  • $err; (transfer ownership: full) a return location for a Gnome::Glib::T-error
  • $domain; error domain.
  • $code; error code.
  • $message; error message.