[libgxps] Improved error checking when parsing a broken FixedDocumentSequence
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgxps] Improved error checking when parsing a broken FixedDocumentSequence
- Date: Tue, 2 Aug 2011 12:51:45 +0000 (UTC)
commit 39eb02782ec6952e3e8e9ed5d237f9ba0e697b1b
Author: Jason Crain <jason aquaticape us>
Date: Sun Jul 31 11:38:16 2011 -0500
Improved error checking when parsing a broken FixedDocumentSequence
libgxps/gxps-file.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libgxps/gxps-file.c b/libgxps/gxps-file.c
index 6b7f5f6..02af1b2 100644
--- a/libgxps/gxps-file.c
+++ b/libgxps/gxps-file.c
@@ -196,7 +196,10 @@ gxps_file_parse_fixed_repr (GXPSFile *xps,
stream = gxps_archive_open (xps->priv->zip,
xps->priv->fixed_repr);
if (!stream) {
- /* TODO: fill error */
+ g_set_error_literal (error,
+ GXPS_FILE_ERROR,
+ GXPS_FILE_ERROR_INVALID,
+ "Invalid XPS File: cannot open fixedrepresentation");
return FALSE;
}
@@ -329,7 +332,10 @@ gxps_file_initable_init (GInitable *initable,
return FALSE;
}
- gxps_file_parse_fixed_repr (xps, error);
+ if (!gxps_file_parse_fixed_repr (xps, &xps->priv->init_error)) {
+ g_propagate_error (error, g_error_copy (xps->priv->init_error));
+ return FALSE;
+ }
if (!xps->priv->docs) {
g_set_error_literal (&xps->priv->init_error,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]