summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/pure/parsecsv.nim5
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) =