- fixed: IPAddress::StringParseError did not inherit from std::exception and was thus not caught properly

Tue, 16 Dec 2014 00:05:27 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Tue, 16 Dec 2014 00:05:27 +0200
changeset 50
874bbfa55da8
parent 49
9e0f26f020e1
child 51
481073b016a9

- fixed: IPAddress::StringParseError did not inherit from std::exception and was thus not caught properly
- fixed: IP string parse errors were also not printed properly (newline was missing)

sources/interface.cpp file | annotate | diff | comparison | revisions
sources/network/ipaddress.h file | annotate | diff | comparison | revisions
--- a/sources/interface.cpp	Mon Dec 15 23:58:01 2014 +0200
+++ b/sources/interface.cpp	Tue Dec 16 00:05:27 2014 +0200
@@ -804,7 +804,7 @@
 			}
 			catch (std::exception& e)
 			{
-				print (e.what());
+				print ("%1\n", e.what());
 				return;
 			}
 
@@ -933,7 +933,7 @@
 	}
 	catch (std::exception& e)
 	{
-		print (e.what());
+		print ("%1\n", e.what());
 		return;
 	}
 
--- a/sources/network/ipaddress.h	Mon Dec 15 23:58:01 2014 +0200
+++ b/sources/network/ipaddress.h	Tue Dec 16 00:05:27 2014 +0200
@@ -38,7 +38,7 @@
 
 struct IPAddress
 {
-	class StringParseError
+	class StringParseError : public std::exception
 	{
 		String m_message;
 

mercurial