Changeset

853:c0a40522041e

prosody: Log top-level errors
author Matthew Wild <mwild1@gmail.com>
date Mon, 02 Mar 2009 19:44:46 +0000
parents 852:3c2d99ba1dc2
children 854:b9cfc9d5496a
files prosody
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/prosody	Mon Mar 02 13:52:08 2009 +0000
+++ b/prosody	Mon Mar 02 19:44:46 2009 +0000
@@ -158,6 +158,14 @@
 						quitting = true;
 						return;
 					end
-					eventmanager.fire_event("very-bad-error", "*", err, debug.traceback("", 2));
+
+					log("error", "Top-level error, please report:\n%s", tostring(err));
+
+					local traceback = debug.traceback("", 2);
+					if traceback then
+						log("error", "%s", traceback);
+					end
+					
+					eventmanager.fire_event("very-bad-error", "*", err, traceback);
 				end);
 end