[libzapojit] Add some error codes
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libzapojit] Add some error codes
- Date: Thu, 24 Oct 2013 12:16:08 +0000 (UTC)
commit 3ef9779520737d9cdc5991d76bd0dec456fd7d82
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Oct 22 17:11:34 2013 +0200
Add some error codes
Fixes: https://bugzilla.gnome.org/710653
docs/reference/libzapojit-0.0-docs.sgml | 1 +
src/Makefile.am | 2 +
src/zpj-error.c | 42 ++++++++++++++++++++++++
src/zpj-error.h | 54 +++++++++++++++++++++++++++++++
src/zpj.h | 1 +
5 files changed, 100 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/libzapojit-0.0-docs.sgml b/docs/reference/libzapojit-0.0-docs.sgml
index ace36ce..ea47ea6 100644
--- a/docs/reference/libzapojit-0.0-docs.sgml
+++ b/docs/reference/libzapojit-0.0-docs.sgml
@@ -61,6 +61,7 @@
<xi:include href="xml/zpj-skydrive-file.xml"/>
<xi:include href="xml/zpj-skydrive-folder.xml"/>
<xi:include href="xml/zpj-skydrive-photo.xml"/>
+ <xi:include href="xml/zpj-error.xml"/>
</chapter>
<index>
diff --git a/src/Makefile.am b/src/Makefile.am
index cee6cf7..63048e5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,6 +9,7 @@ libzapojit_0_0_la_built_sources = \
libzapojit_0_0_la_headers = \
zpj-authorization-domain.h \
zpj-authorizer.h \
+ zpj-error.h \
zpj-goa-authorizer.h \
zpj-skydrive.h \
zpj-skydrive-entry.h \
@@ -21,6 +22,7 @@ libzapojit_0_0_la_SOURCES = \
$(libzapojit_0_0_la_built_sources) \
zpj-authorization-domain.c \
zpj-authorizer.c \
+ zpj-error.c \
zpj-goa-authorizer.c \
zpj-skydrive.c \
zpj-skydrive-entry.c \
diff --git a/src/zpj-error.c b/src/zpj-error.c
new file mode 100644
index 0000000..d8b75c6
--- /dev/null
+++ b/src/zpj-error.c
@@ -0,0 +1,42 @@
+/*
+ * Zapojit - GLib/GObject wrapper for the SkyDrive and Hotmail REST APIs
+ * Copyright © 2013 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+
+#include "config.h"
+
+#include "zpj-error.h"
+
+
+/**
+ * SECTION:zpj-error
+ * @title: ZpjError
+ * @short_description: Error codes.
+ * @include: zpj/zpj.h
+ *
+ * Error codes used to represent errors thrown by the SkyDrive and
+ * Hotmail REST APIs.
+ */
+
+
+GQuark
+zpj_error_quark (void)
+{
+ return g_quark_from_static_string ("zpj-error-quark");
+}
diff --git a/src/zpj-error.h b/src/zpj-error.h
new file mode 100644
index 0000000..7e45780
--- /dev/null
+++ b/src/zpj-error.h
@@ -0,0 +1,54 @@
+/*
+ * Zapojit - GLib/GObject wrapper for the SkyDrive and Hotmail REST APIs
+ * Copyright © 2013 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef ZPJ_ERROR_H
+#define ZPJ_ERROR_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ZPJ_ERROR:
+ *
+ * Error domain for libzapojit. Errors in this domain will be from the
+ * #ZpjError enumeration. See #GError for more information on error domains.
+ */
+#define ZPJ_ERROR (zpj_error_quark ())
+
+/**
+ * ZpjError:
+ * @ZPJ_ERROR_REQUEST_URL_INVALID: The server received an invalid URL,
+ * possibly because of an invalid @file_id.
+ * @ZPJ_ERROR_UNKNOWN: An unknown error occurred.
+ *
+ * This enumeration can be expanded at a later date.
+ */
+typedef enum
+{
+ ZPJ_ERROR_REQUEST_URL_INVALID,
+ ZPJ_ERROR_UNKNOWN
+} ZpjError;
+
+GQuark zpj_error_quark (void);
+
+G_END_DECLS
+
+#endif /* ZPJ_ERROR_H */
diff --git a/src/zpj.h b/src/zpj.h
index c3ebc63..9cf8acb 100644
--- a/src/zpj.h
+++ b/src/zpj.h
@@ -23,6 +23,7 @@
#include <zpj/zpj-authorization-domain.h>
#include <zpj/zpj-authorizer.h>
+#include <zpj/zpj-error.h>
#include <zpj/zpj-goa-authorizer.h>
#include <zpj/zpj-skydrive.h>
#include <zpj/zpj-skydrive-entry.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]