Convert GIOError too when converting from GError to AtomError
[cascardo/atompub.git] / src / error.c
index cdb3178..a8e08e4 100644 (file)
@@ -20,6 +20,7 @@
 #include <atompub/atom.h>
 
 #include <glib.h>
+#include <gio/gio.h>
 
 struct _atom_error
 {
@@ -91,6 +92,18 @@ atom_error_new_from_gerror (GError *error)
            break;
        }
     }
+  else if (error->domain = G_IO_ERROR)
+    {
+      switch (error->code)
+       {
+         case G_IO_ERROR_NOT_FOUND:
+           aerr->code = 404;
+           break;
+         default:
+           aerr->code = 500;
+           break;
+       }
+    }
   else
     {
       aerr->code = 500;