{
IRI *iri = iri_new ();
Atom *atom;
+ GError *error;
iri_set_path (iri, path);
atom = atom_retrieve_resource (ctx, iri);
iri_delete (iri);
write (1, atom_string (atom), atom_len (atom));
atom_delete (atom);
}
+ else if ((error = atom_error_get (ctx)) != NULL)
+ {
+ if (error->domain == G_FILE_ERROR &&
+ (error->code == G_FILE_ERROR_EXIST ||
+ error->code == G_FILE_ERROR_ACCESS ||
+ error->code == G_FILE_ERROR_PERM))
+ fprintf (stdout, "Status: 403 %s\n\n", err->message);
+ else if (error->domain == G_FILE_ERROR &&
+ error->code == G_FILE_ERROR_NOENT)
+ fprintf (stdout, "Status: 404 %s\n\n", err->message);
+ else
+ fprintf (stdout, "Status: 500 %s\n\n", err->message);
+ }
}
else
{