From 4c6c9216390f7dee4552846ee17f2bcb3402b43c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 20 Oct 2015 21:55:11 -0400 Subject: .d files made, emacs org babel tangle run on .org files --- lib/sdp/ao_markup_source_raw.d | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lib/sdp/ao_markup_source_raw.d') 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) { -- cgit v1.2.3