glibmm: Gio::Error Class Reference

Exception class for giomm errors. More...

#include </home/kjell/checkout/gnome/glibmm/gio/giomm/error.h>

Inheritance diagram for Gio::Error:

Public Types

Public Member Functions

 Error (Code error_code, const Glib::ustring& error_message)
 
 Error (GError* gobject)
 
Code code () const
 
- Public Member Functions inherited from Glib::Error
 Error ()
 
 Error (GQuark error_domain, int error_code, const Glib::ustring& message)
 
 Error (GError* gobject, bool take_copy=false)
 
 Error (const Error& other)
 
Erroroperator= (const Error& other)
 
 ~Error () noexcept override
 
 operator bool () const
 Test whether the Error has an underlying instance. More...

 
GQuark domain () const
 
int code () const
 
Glib::ustring what () const override
 
bool matches (GQuark error_domain, int error_code) const
 
GError* gobj ()
 
const GError* gobj () const
 
- Public Member Functions inherited from Glib::Exception
virtual ~Exception () noexcept=0
 

Additional Inherited Members

- Protected Attributes inherited from Glib::Error
GError* gobject_
 

Detailed Description

Exception class for giomm errors.

Member Enumeration Documentation

Error codes returned by GIO functions.

Note that this domain may be extended in future GLib releases. In general, new error codes either only apply to new APIs, or else replace Gio::Error::FAILED in cases that were not explicitly distinguished before. You should therefore avoid writing code like

[C example ellipted] but should instead treat all unrecognized error codes the same as Gio::Error::FAILED.

See also PollableReturn for a cheaper way of returning Gio::Error::WOULD_BLOCK to callers without allocating a Error.

Enumerator
FAILED 

Generic error condition for when an operation fails and no more specific Gio::Error value is defined.

NOT_FOUND 

File not found.

EXISTS 

File already exists.

IS_DIRECTORY 

File is a directory.

NOT_DIRECTORY 

File is not a directory.

NOT_EMPTY 

File is a directory that isn't empty.

NOT_REGULAR_FILE 

File is not a regular file.

NOT_SYMBOLIC_LINK 

File is not a symbolic link.

NOT_MOUNTABLE_FILE 

File cannot be mounted.

FILENAME_TOO_LONG 

Filename is too many characters.

INVALID_FILENAME 

Filename is invalid or contains invalid characters.

TOO_MANY_LINKS 

File contains too many symbolic links.

NO_SPACE 

No space left on drive.

INVALID_ARGUMENT 

Invalid argument.

PERMISSION_DENIED 

Permission denied.

NOT_SUPPORTED 

Operation (or one of its parameters) not supported.

NOT_MOUNTED 

File isn't mounted.

ALREADY_MOUNTED 

File is already mounted.

CLOSED 

File was closed.

CANCELLED 

Operation was cancelled.

See Cancellable.

PENDING 

Operations are still pending.

READ_ONLY 

File is read only.

CANT_CREATE_BACKUP 

Backup couldn't be created.

WRONG_ETAG 

File's Entity Tag was incorrect.

TIMED_OUT 

Operation timed out.

WOULD_RECURSE 

Operation would be recursive.

BUSY 

File is busy.

WOULD_BLOCK 

Operation would block.

HOST_NOT_FOUND 

Host couldn't be found (remote operations).

HOST_WAS_NOT_FOUND 
WOULD_MERGE 

Operation would merge files.

FAILED_HANDLED 

Operation failed and a helper program has already interacted with the user.

Do not display any error dialog.

TOO_MANY_OPEN_FILES 

The current process has too many files open and can't open any more.

Duplicate descriptors do count toward this limit.

Since glibmm 2.20:
NOT_INITIALIZED 

The object has not been initialized.

Since glibmm 2.22:
ADDRESS_IN_USE 

The requested address is already in use.

Since glibmm 2.22:
PARTIAL_INPUT 

Need more input to finish operation.

Since glibmm 2.24:
INVALID_DATA 

The input data was invalid.

Since glibmm 2.24:
DBUS_ERROR 

A remote object generated an error that doesn't correspond to a locally registered Error error domain.

Use g_dbus_error_get_remote_error() to extract the D-Bus error name and g_dbus_error_strip_remote_error() to fix up the message so it matches what was received on the wire.

Since glibmm 2.26:
HOST_UNREACHABLE 

Host unreachable.

Since glibmm 2.26:
NETWORK_UNREACHABLE 

Network unreachable.

Since glibmm 2.26:
CONNECTION_REFUSED 

Connection refused.

Since glibmm 2.26:
PROXY_FAILED 

Connection to proxy server failed.

Since glibmm 2.26:
PROXY_AUTH_FAILED 

Proxy authentication failed.

Since glibmm 2.26:
PROXY_NEED_AUTH 

Proxy server needs authentication.

Since glibmm 2.26:
PROXY_NOT_ALLOWED 

Proxy connection is not allowed by ruleset.

Since glibmm 2.26:
BROKEN_PIPE 

Broken pipe.

Since glibmm 2.36:
CONNECTION_CLOSED 

Connection closed by peer.

Note that this is the same code as Gio::Error::BROKEN_PIPE; before 2.44 some "connection closed" errors returned Gio::Error::BROKEN_PIPE, but others returned Gio::Error::FAILED. Now they should all return the same value, which has this more logical name.

Since glibmm 2.44:
NOT_CONNECTED 

Transport endpoint is not connected.

Since glibmm 2.44:
MESSAGE_TOO_LARGE 

Message too large.

Since glibmm 2.48:

Constructor & Destructor Documentation

Gio::Error::Error ( Code  error_code,
const Glib::ustring error_message 
)
Gio::Error::Error ( GError *  gobject)
explicit

Member Function Documentation

Code Gio::Error::code ( ) const