From: Matthias Kramm Date: Thu, 7 Jan 2010 02:07:16 +0000 (-0800) Subject: ruby interface: raise an exception if we couldn't open a file X-Git-Tag: version-0-9-1~196 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=8e7a42a2c252dcad56aa9e05bd4025c16c558e2c ruby interface: raise an exception if we couldn't open a file --- diff --git a/lib/ruby/gfx.c b/lib/ruby/gfx.c index 661d8ef..958ce40 100644 --- a/lib/ruby/gfx.c +++ b/lib/ruby/gfx.c @@ -63,6 +63,9 @@ static VALUE doc_initialize(VALUE cls, VALUE _filename) const char*filename = StringValuePtr(_filename); doc->fontlist = gfxfontlist_create(); doc->doc = pdfdriver->open(pdfdriver, filename); + if(!doc->doc) { + rb_raise(rb_eIOError, "couldn't open %s", filename); + } return cls; }