From 95872e6d0effefb74e7c64169c194db557f4bac0 Mon Sep 17 00:00:00 2001 From: Cameron Ross Date: Tue, 17 Jul 2018 20:41:59 -0300 Subject: [PATCH] don't throw away file/line when throwing new YAMLExceptions --- source/dyaml/dumper.d | 4 ++-- source/dyaml/loader.d | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/dyaml/dumper.d b/source/dyaml/dumper.d index 4f3be4b..0e4d63e 100644 --- a/source/dyaml/dumper.d +++ b/source/dyaml/dumper.d @@ -225,7 +225,7 @@ struct Dumper(Range) catch(YAMLException e) { throw new YAMLException("Unable to dump YAML to stream " - ~ name_ ~ " : " ~ e.msg); + ~ name_ ~ " : " ~ e.msg, e.file, e.line); } } @@ -251,7 +251,7 @@ struct Dumper(Range) catch(YAMLException e) { throw new YAMLException("Unable to emit YAML to stream " - ~ name_ ~ " : " ~ e.msg); + ~ name_ ~ " : " ~ e.msg, e.file, e.line); } } } diff --git a/source/dyaml/loader.d b/source/dyaml/loader.d index 7ab4a06..ceb7d21 100644 --- a/source/dyaml/loader.d +++ b/source/dyaml/loader.d @@ -71,7 +71,7 @@ struct Loader catch(FileException e) { throw new YAMLException("Unable to open file %s for YAML loading: %s" - .format(filename, e.msg)); + .format(filename, e.msg), e.file, e.line); } } /// ditto @@ -208,7 +208,7 @@ struct Loader catch(YAMLException e) { throw new YAMLException("Unable to load YAML from %s : %s" - .format(name_, e.msg)); + .format(name_, e.msg), e.file, e.line); } } @@ -279,7 +279,7 @@ struct Loader catch(YAMLException e) { throw new YAMLException("Unable to load YAML from %s : %s " - .format(name_, e.msg)); + .format(name_, e.msg), e.file, e.line); } } // Scan and return all tokens. Used for debugging. @@ -297,7 +297,7 @@ struct Loader catch(YAMLException e) { throw new YAMLException("Unable to scan YAML from stream " ~ - name_ ~ " : " ~ e.msg); + name_ ~ " : " ~ e.msg, e.file, e.line); } } @@ -311,7 +311,7 @@ struct Loader catch(YAMLException e) { throw new YAMLException("Unable to scan YAML from stream " ~ - name_ ~ " : " ~ e.msg); + name_ ~ " : " ~ e.msg, e.file, e.line); } }