From 96df7fcbf9dc2ba8d1da48a29baf35262d62287d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 May 2005 04:37:51 +0000 Subject: r7005: added a esp page to demonstrate exception handling (This used to be commit 96c15646d2f29dd2839a2bab4b9e57bddfd2cee1) --- swat/esptest/exception.esp | 37 +++++++++++++++++++++++++++++++++++++ swat/esptest/index.esp | 3 ++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 swat/esptest/exception.esp (limited to 'swat') diff --git a/swat/esptest/exception.esp b/swat/esptest/exception.esp new file mode 100644 index 0000000000..d569fbe776 --- /dev/null +++ b/swat/esptest/exception.esp @@ -0,0 +1,37 @@ + + +Samba4 ESP test + + +

Samba4 exception test

+ +
+ + +
+
+ +<% +if (request['REQUEST_METHOD'] == "POST") { + /* if they cancelled then take them back to the list of tests */ + if (form['submit'] == "Cancel") { + redirect("index.esp"); + } + + function TestFunction(arg1, arg2) { + return "OK"; + } + + if (form['submit'] == "Generate Exception") { + write("I expect you to die Mr Bond!
\n"); + TestFunction("foo"); + } else { + write("no exception
\n"); + TestFunction("foo", "bar"); + } +} +%> + +and here is some filler text ... + + diff --git a/swat/esptest/index.esp b/swat/esptest/index.esp index e85937e4bf..7a5952e955 100644 --- a/swat/esptest/index.esp +++ b/swat/esptest/index.esp @@ -1,5 +1,6 @@ <% - var tests = new Array("formtest", "showvars", "include", "session", "loadparm"); + var tests = new Array("formtest", "showvars", "include", + "session", "loadparm", "exception"); %> -- cgit