From 9d346aa8894e567d2871125826488c2ca181d0f5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Apr 2015 15:44:57 +0200 Subject: Further interface prototyping --- brep/module.cxx | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 brep/module.cxx (limited to 'brep/module.cxx') 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 + +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); + } + } +} -- cgit v1.1