diff --git a/APPL/Shared/500_error.asp b/APPL/Shared/500_error.asp
index 8cb553bf8f..4b78f77784 100644
--- a/APPL/Shared/500_error.asp
+++ b/APPL/Shared/500_error.asp
@@ -302,6 +302,7 @@ if (Application("otap_environment") == "O" || Session("logging") > 0)
Response.Write("\n
" + ShowSourcecode(-8, +4));
}
+Session.Contents.Remove("last_sql");
Response.End;
function ASPErrorText(extra)
@@ -320,6 +321,11 @@ function ASPErrorText(extra)
err += "
| "+props[v]+": | " + safeprop + " |
";
}
}
+ if (Session("last_sql")) // vanuit m_connections.inc
+ {
+ err += "| Last SQL: | " + Server.HTMLEncode(Session("last_sql")) + " |
";
+ }
+
err += "";
return err;
}
diff --git a/APPL/Shared/m_connections.inc b/APPL/Shared/m_connections.inc
index c659428c28..66a4ab87df 100644
--- a/APPL/Shared/m_connections.inc
+++ b/APPL/Shared/m_connections.inc
@@ -26,7 +26,6 @@ function SafeExec( sql, catchErrors ) {
result = {}; // er moet later wel een err.friendlyMsg getest kunnen worden
}
} catch( e1 ) {
-
__LogCloseLine(null, "FAIL", "#FF0000");
var msg = e1.description;
var knownError = false;
@@ -92,7 +91,10 @@ function SafeExec( sql, catchErrors ) {
}
if (!catchErrors)
+ {
+ Session("last_sql") = sql; // wordt door 500-error.asp opgepikt
throw e1; // Throw again
+ }
else
return _LastFacError;
}