diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-10-26 12:45:00 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-10-26 12:45:00 +0200 |
commit | d50260de20df36c03829ae4a3c7a6562e152db14 (patch) | |
tree | dd5afff15533c87d62fb2405bd8d73caeeccf8a3 | |
parent | 129a599cd677e6682ddb899b92c785c205ed5e2e (diff) | |
download | Nim-d50260de20df36c03829ae4a3c7a6562e152db14.tar.gz |
fixes #6148
-rw-r--r-- | lib/pure/parsecsv.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pure/parsecsv.nim b/lib/pure/parsecsv.nim index 77b145a73..ca0f3f9e0 100644 --- a/lib/pure/parsecsv.nim +++ b/lib/pure/parsecsv.nim @@ -72,7 +72,10 @@ proc raiseEInvalidCsv(filename: string, line, col: int, msg: string) {.noreturn.} = var e: ref CsvError new(e) - e.msg = filename & "(" & $line & ", " & $col & ") Error: " & msg + if filename.len == 0: + e.msg = "Error: " & msg + else: + e.msg = filename & "(" & $line & ", " & $col & ") Error: " & msg raise e proc error(my: CsvParser, pos: int, msg: string) = |