GOErrorInfo

GOErrorInfo

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── GOErrorInfo

Description

Functions

GO_INIT_RET_ERROR_INFO()

#define             GO_INIT_RET_ERROR_INFO(ret_error)

go_error_info_add_details ()

void
go_error_info_add_details (GOErrorInfo *error,
                           GOErrorInfo *details);

Takes ownership of details and adds it to the details of error . If details has no message, its details are merged into error and the empty container is released. Does nothing if details is NULL.

Parameters

error

GOErrorInfo

 

details

GOErrorInfo to add.

[transfer full][nullable]

go_error_info_add_details_list ()

void
go_error_info_add_details_list (GOErrorInfo *error,
                                GSList *details);

Takes ownership of details and all its elements, adding them to the details of error . Empty containers in details are replaced by their own details. Does nothing if details is NULL.

Parameters

error

GOErrorInfo

 

details

a list of GOErrorInfo to add.

[element-type GOErrorInfo][transfer full][nullable]

go_error_info_free ()

void
go_error_info_free (GOErrorInfo *error);

Releases a reference on error . When the last reference is released, the message and all attached details are freed. Does nothing if error is NULL.

Parameters

error

GOErrorInfo to free.

[nullable]

go_error_info_new_from_errno ()

GOErrorInfo *
go_error_info_new_from_errno (void);

Creates a new GOErrorInfo with severity GO_ERROR and a message describing the current value of errno (see g_strerror()).

Returns

the newly created GOErrorInfo.

[transfer full]


go_error_info_new_from_error_list ()

GOErrorInfo *
go_error_info_new_from_error_list (GSList *errors);

Creates a new GOErrorInfo from errors . If errors contains a single error, that error is returned directly; otherwise the errors are attached as details to a new error with no message.

Parameters

errors

a list of GOErrorInfo.

[element-type GOErrorInfo][transfer full][nullable]

Returns

the new GOErrorInfo, or NULL if errors is empty.

[transfer full][nullable]


go_error_info_new_printf ()

GOErrorInfo *
go_error_info_new_printf (char const *msg_format,
                          ...);

Creates a new GOErrorInfo with severity GO_ERROR and a message built from msg_format and the provided arguments.

Parameters

msg_format

printf-style format string for the error message

 

...

arguments for msg_format

 

Returns

the newly created GOErrorInfo.

[transfer full]


go_error_info_new_str ()

GOErrorInfo *
go_error_info_new_str (char const *msg);

Creates a new GOErrorInfo with severity GO_ERROR and no details.

Parameters

msg

error message.

[nullable]

Returns

the newly created GOErrorInfo.

[transfer full]


go_error_info_new_str_with_details ()

GOErrorInfo *
go_error_info_new_str_with_details (char const *msg,
                                    GOErrorInfo *details);

Creates a new GOErrorInfo from msg and an existing GOErrorInfo instance to add to the message.

Parameters

msg

error message.

[nullable]

details

GOErrorInfo to add.

[transfer full][nullable]

Returns

the newly created GOErrorInfo.

[transfer full]


go_error_info_new_str_with_details_list ()

GOErrorInfo *
go_error_info_new_str_with_details_list
                               (char const *msg,
                                GSList *details);

Creates a new GOErrorInfo from msg and a list of existing GOErrorInfo instances to add to the message.

Parameters

msg

error message.

[nullable]

details

a list of GOErrorInfo to add.

[element-type GOErrorInfo][transfer full][nullable]

Returns

the newly created GOErrorInfo.

[transfer full]


go_error_info_new_vprintf ()

GOErrorInfo *
go_error_info_new_vprintf (GOSeverity severity,
                           char const *msg_format,
                           va_list args);

Creates a new GOErrorInfo with the given severity and a message built from msg_format and args .

Parameters

severity

severity of the error, either GO_WARNING or GO_ERROR

 

msg_format

printf-style format string for the error message

 

args

arguments for msg_format

 

Returns

the newly created GOErrorInfo.

[transfer full]


go_error_info_peek_details ()

GSList *
go_error_info_peek_details (GOErrorInfo *error);

Parameters

error

GOErrorInfo

 

Returns

the details in error , or NULL if there are none.

[element-type GOErrorInfo][transfer none][nullable]


go_error_info_peek_message ()

char const*
go_error_info_peek_message (GOErrorInfo *error);

Parameters

error

GOErrorInfo

 

Returns

the message in error , or NULL for an error that only contains details.

[nullable][transfer none]


go_error_info_peek_severity ()

GOSeverity
go_error_info_peek_severity (GOErrorInfo *error);

Parameters

error

GOErrorInfo

 

Returns

the severity of error


go_error_info_print ()

void
go_error_info_print (GOErrorInfo *error);

Prints error and all its details to standard error. Messages are prefixed with E or W according to their severity, and details are indented below their parent.

Parameters

error

GOErrorInfo to print

 

Types and Values

GOErrorInfo

typedef struct _GOErrorInfo GOErrorInfo;

enum GOSeverity

Members

GO_WARNING

warning.

 

GO_ERROR

error.