~i-taylor/maus/map-base

« back to all changes in this revision

Viewing changes to src/common_cpp/Globals/GlobalsManager.cc

  • Committer: Ian Taylor
  • Date: 2013-08-12 12:52:07 UTC
  • mfrom: (663.8.7 release)
  • Revision ID: i.taylor@warwick.ac.uk-20130812125207-0ybrhlzc1p1ujbhx
Merging with V 0.6.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *
16
16
 */
17
17
 
18
 
#include "src/legacy/Interface/Squeal.hh"
19
 
#include "src/legacy/Interface/Squeak.hh"
20
18
#include "src/legacy/Interface/MICERun.hh"
21
19
#include "src/legacy/Config/MiceModule.hh"
22
20
 
 
21
#include "src/common_cpp/Utils/Exception.hh"
23
22
#include "src/common_cpp/Utils/CppErrorHandler.hh"
24
23
#include "src/common_cpp/Utils/RunActionManager.hh"
25
24
#include "src/common_cpp/Utils/Globals.hh"
37
36
// then legacy cards and run data
38
37
void GlobalsManager::InitialiseGlobals(std::string json_datacards) {
39
38
    if (Globals::_process != NULL) {
40
 
        throw(Squeal(Squeal::recoverable,
 
39
        throw(Exception(Exception::recoverable,
41
40
      "Attempt to initialise Globals when it was already initialised",
42
41
                      "GlobalsManager::InitialiseGlobals"));
43
42
    }
54
53
                                                 process->_configuration_cards;
55
54
        int verbose_level = JsonWrapper::GetProperty
56
55
                       (config, "verbose_level", JsonWrapper::intValue).asInt();
 
56
        bool stack = JsonWrapper::GetProperty
 
57
               (config, "will_do_stack_trace", JsonWrapper::booleanValue).asBool();
 
58
        Exception::SetWillDoStackTrace(stack);
57
59
        // we set up logging but for now leave singleton-like access
58
60
        // meaning that we can't reinitialise the logging
59
61
        Logging::setStandardOutputs(verbose_level);
87
89
            process->_recon_field_constructor =
88
90
                                 new BTFieldConstructor(process->_recon_mods);
89
91
        }
90
 
    } catch(Squeal squee) {
 
92
    } catch(Exception squee) {
91
93
        Globals::_process = NULL;
92
94
        delete process;
93
95
        throw squee;
98
100
    // we don't delete the MICERun as this isn't really meant to be deleted
99
101
    // (it's legacy anyway)
100
102
    if (Globals::_process == NULL) {
101
 
        throw(Squeal(Squeal::recoverable,
 
103
        throw(Exception(Exception::recoverable,
102
104
             "Attempt to delete Globals when it was not initialised",
103
105
                      "GlobalsManager::DeleteGlobals"));
104
106
    }