sources/format.cpp

changeset 5
146825d63b9a
parent 1
4dd5bde4e777
child 60
268721e6be20
--- a/sources/format.cpp	Wed Dec 10 19:26:13 2014 +0200
+++ b/sources/format.cpp	Thu Dec 11 05:58:55 2014 +0200
@@ -31,7 +31,7 @@
 #include <cstdio>
 #include "format.h"
 
-//
+// -------------------------------------------------------------------------------------------------
 // Throws an error while formatting the string
 //
 static auto format_error (String fmtstr, const String errdescribe, int pos) -> void
@@ -44,14 +44,11 @@
 		errmsg += "-";
 
 	errmsg += "^\n" + errdescribe;
-	// throw std::logic_error (errmsg.stdString());
-	std::fprintf (stderr, "%s", errmsg.chars());
-	std::exit (EXIT_FAILURE);
+	throw std::logic_error (errmsg.std_string());
 }
 
-//
-// Main formatter algorithm autoion. Processes @fmtstr with @args and returns
-// the result.
+// -------------------------------------------------------------------------------------------------
+// Main formatter algorithm.
 //
 auto format_args (const String& fmtstr, const Vector<String>& args) -> String
 {

mercurial