summaryrefslogtreecommitdiffstats
path: root/scripts/MarkdownBook/Document.pm
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-08-12 10:08:43 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-08-12 10:08:43 (EDT)
commit04d0684d2da625037e6472639d1884fb9a55ac83 (patch)
tree2a87ad49ac9a7266df5011810fafc6bc0c0043ff /scripts/MarkdownBook/Document.pm
parentc0f12961b11ab4f8ec839c911dd5d4dff03a7092 (diff)
Improve error handling.
Diffstat (limited to 'scripts/MarkdownBook/Document.pm')
-rw-r--r--scripts/MarkdownBook/Document.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/MarkdownBook/Document.pm b/scripts/MarkdownBook/Document.pm
index b84503d..fa47cdb 100644
--- a/scripts/MarkdownBook/Document.pm
+++ b/scripts/MarkdownBook/Document.pm
@@ -17,6 +17,7 @@ use strict;
use warnings;
use MarkdownBook::Section;
+use Carp;
package MarkdownBook::Document;
@@ -143,7 +144,8 @@ sub parse
my $source_text;
open($source_fh, '<',
- $self->{'book'}->dir() . '/' . $self->{'file'} . '.mdwn');
+ $self->{'book'}->dir() . '/' . $self->{'file'} . '.mdwn')
+ or croak('Cannot open "' . $self->{'file'} . '" source document');
$source_text = join('', <$source_fh>);
close($source_fh);