2 * Copyright (C) 2008 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include <atompub/atom.h>
34 error = g_slice_new (AtomError);
36 error->message = NULL;
41 atom_error_delete (AtomError *error)
44 g_free (error->message);
45 g_slice_free (AtomError, error);
49 atom_error_code (AtomError *error)
55 atom_error_code_set (AtomError *error, int code)
61 atom_error_message (AtomError *error)
63 return error->message;
67 atom_error_message_set (AtomError *error, char *message)
69 error->message = g_strdup (message);
73 atom_error_new_from_gerror (GError *error)
76 aerr = atom_error_new ();
77 if (error->domain == G_FILE_ERROR)
81 case G_FILE_ERROR_EXIST:
82 case G_FILE_ERROR_ACCES:
83 case G_FILE_ERROR_PERM:
86 case G_FILE_ERROR_NOENT:
98 aerr->message = g_strdup (error->message);