diff options
author | Ralph Amissah <ralph@amissah.com> | 2015-10-20 21:55:11 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2015-10-20 23:10:37 -0400 |
commit | 4c6c9216390f7dee4552846ee17f2bcb3402b43c (patch) | |
tree | 15750b24ed5cda482908fad4cfad73f7477423a2 /lib/sdp/ao_markup_source_raw.d | |
parent | literate programming introduced, tangle not yet run (diff) |
.d files made, emacs org babel tangle run on .org files
Diffstat (limited to 'lib/sdp/ao_markup_source_raw.d')
-rw-r--r-- | lib/sdp/ao_markup_source_raw.d | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/sdp/ao_markup_source_raw.d b/lib/sdp/ao_markup_source_raw.d index 3d937ac..fb76e98 100644 --- a/lib/sdp/ao_markup_source_raw.d +++ b/lib/sdp/ao_markup_source_raw.d @@ -1,6 +1,6 @@ /* -#+OPTIONS: ^:nil _:nil#+OPTIONS: ^:nil _:nil -* sisu_markup_source_raw.d + markup source raw + ao_markup_source_raw.d */ mixin template SiSUmarkupRaw() { class MarkupRaw { @@ -11,12 +11,21 @@ mixin template SiSUmarkupRaw() { "file not found" ); string source_txt_str; - if (exists(fn_src)) { - source_txt_str = readText(fn_src); // ok - std.utf.validate(source_txt_str); + try { + if (exists(fn_src)) { + source_txt_str = readText(fn_src); // ok + } } - // string source_txt_str = cast(string) read(fn_src); - // std.utf.validate(source_txt_str); + catch (ErrnoException ex) { + // Handle errors + } + catch (UTFException ex) { + // Handle validation errors + } + catch (FileException ex) { + // Handle errors + } + std.utf.validate(source_txt_str); return source_txt_str; } final private char[][] markupSourceLineArray(in string src_text) { |