~mbogomilov/maus/devel3

« back to all changes in this revision

Viewing changes to src/common_cpp/JsonCppProcessors/ArrayProcessors-inl.hh

  • Committer: Durga Rajaram
  • Date: 2014-01-14 07:07:02 UTC
  • mfrom: (659.1.80 relcand)
  • Revision ID: durga@fnal.gov-20140114070702-2l1fuj1w6rraw7xe
Tags: MAUS-v0.7.6
MAUS-v0.7.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
                                               (const Json::Value& json_array) {
43
43
    if (!json_array.isConvertibleTo(Json::arrayValue)) {
44
44
        // no memory allocated yet...
45
 
        throw(Squeal(Squeal::recoverable,
 
45
        throw(Exception(Exception::recoverable,
46
46
                    "Failed to resolve Json::Value of type "+
47
47
                    JsonWrapper::ValueTypeToString(json_array.type())+
48
48
                    " to array",
63
63
                if (RefManager::HasInstance())
64
64
                    RefManager::GetInstance().SetPointerAsValue(path, (*vec)[i]);
65
65
            }
66
 
        } catch(Squeal squee) {
 
66
        } catch(Exception exc) {
67
67
            // if there's a problem, clean up before rethrowing the exception
68
68
            for (size_t j = 0; j < vec->size(); ++j) {
69
69
                if ((*vec)[j] != NULL) {
71
71
                }
72
72
            }
73
73
            delete vec;
74
 
            throw squee;
 
74
            throw exc;
75
75
        }
76
76
    }
77
77
    return vec;
106
106
            if (RefManager::HasInstance())
107
107
                RefManager::GetInstance().SetPointerAsValue
108
108
                                               (cpp_array[i], GetPath(path, i));
109
 
        } catch(Squeal squee) {
 
109
        } catch(Exception exc) {
110
110
            // if there's a problem, clean up before rethrowing the exception
111
111
            delete json_array;
112
 
            throw squee;
 
112
            throw exc;
113
113
        }
114
114
    }
115
115
    return json_array;
142
142
                                               (const Json::Value& json_array) {
143
143
    if (!json_array.isConvertibleTo(Json::arrayValue)) {
144
144
        // no memory allocated yet...
145
 
        throw(Squeal(Squeal::recoverable,
 
145
        throw(Exception(Exception::recoverable,
146
146
                    "Failed to resolve Json::Value of type "+
147
147
                    JsonWrapper::ValueTypeToString(json_array.type())+
148
148
                    " to array",
158
158
            ArrayContents* data = _proc->JsonToCpp(json_array[i]);
159
159
            (*vec)[i] = *data;
160
160
            delete data;
161
 
        } catch(Squeal squee) {
 
161
        } catch(Exception exc) {
162
162
            // if there's a problem, clean up before rethrowing the exception
163
163
            delete vec;
164
 
            throw squee;
 
164
            throw exc;
165
165
        }
166
166
    }
167
167
    return vec;
189
189
            (*json_array)[i] = *data; // json copies memory but not path
190
190
            JsonWrapper::Path::SetPath((*json_array)[i], GetPath(path, i));
191
191
            delete data; // so we need to clean up here
192
 
        } catch(Squeal squee) {
 
192
        } catch(Exception exc) {
193
193
            // if there's a problem, clean up before rethrowing the exception
194
194
            delete json_array;
195
 
            throw squee;
 
195
            throw exc;
196
196
        }
197
197
    }
198
198
    return json_array;
212
212
    using ReferenceResolver::JsonToCpp::VectorResolver;
213
213
    if (!json_array.isConvertibleTo(Json::arrayValue)) {
214
214
        // no memory allocated yet...
215
 
        throw(Squeal(Squeal::recoverable,
 
215
        throw(Exception(Exception::recoverable,
216
216
                    "Failed to resolve Json::Value of type "+
217
217
                    JsonWrapper::ValueTypeToString(json_array.type())+
218
218
                    " to array",
235
235
                    RefManager::GetInstance().AddReference(res);
236
236
                }
237
237
            }
238
 
        } catch(Squeal squee) {
 
238
        } catch(Exception exc) {
239
239
            // if there's a problem, clean up before rethrowing the exception
240
240
            delete vec;
241
 
            throw squee;
 
241
            throw exc;
242
242
        }
243
243
    }
244
244
    return vec;