bes  Updated for version 3.20.8
besstandalone.cc
1 
2 // This file is part of bes, A C++ back-end server implementation framework
3 // for the OPeNDAP Data Access Protocol.
4 
5 // Copyright (c) 2020 University Corporation for Atmospheric Research
6 // Author: Nathan Potter <ndp@opendap.org>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // You can contact University Corporation for Atmospheric Research at
23 // 3080 Center Green Drive, Boulder, CO 80301
24 
25 #include <iostream>
26 
27 #include "BESError.h"
28 #include "StandAloneApp.h"
29 
30 int main(int argc, char **argv)
31 {
32  try {
33  StandAloneApp app;
34  return app.main(argc, argv);
35  }
36  catch (BESError &e) {
37  std::cerr << "Caught BES Error while starting the command processor: " << e.get_message() << std::endl;
38  return 1;
39  }
40  catch (std::exception &e) {
41  std::cerr << "Caught C++ error while starting the command processor: " << e.what() << std::endl;
42  return 2;
43  }
44  catch (...) {
45  std::cerr << "Caught unknown error while starting the command processor." << std::endl;
46  return 3;
47  }
48 }
virtual int main(int argC, char **argV)
main routine, the main entry point for any BES applications.
Definition: BESApp.cc:54
Abstract exception class for the BES with basic string message.
Definition: BESError.h:58
virtual std::string get_message()
get the error message for this exception
Definition: BESError.h:99