aboutsummaryrefslogtreecommitdiff
path: root/brep/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-09 15:44:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-09 15:44:57 +0200
commit9d346aa8894e567d2871125826488c2ca181d0f5 (patch)
tree870664c4612d246c37d687fba7156de33568bec6 /brep/module.cxx
parentcf5c6478240d8e4fe88c4abddf2234ef18b71c4f (diff)
Further interface prototyping
Diffstat (limited to 'brep/module.cxx')
-rw-r--r--brep/module.cxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/brep/module.cxx b/brep/module.cxx
new file mode 100644
index 0000000..1837ccd
--- /dev/null
+++ b/brep/module.cxx
@@ -0,0 +1,39 @@
+// file : brep/module.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#include <brep/module>
+
+using namespace std;
+
+namespace brep
+{
+ void module::
+ handle (request& rq, response& rs, log& l)
+ {
+ log_ = &l;
+
+ try
+ {
+ handle (rq, rs);
+ }
+ catch (const invalid_request& e)
+ {
+ // @@ Format as HTML in proper style.
+ //
+ rs.content (e.status, "text/html;charset=utf-8") << e.description;
+ }
+ catch (const exception& e)
+ {
+ // @@ Exception: log e.what () & 505.
+ //
+ rs.status (505);
+ }
+ catch (...)
+ {
+ // @@ Unknown exception: log & 505.
+ //
+ rs.status (505);
+ }
+ }
+}