@@ -166,7 +166,7 @@ class Conf {
166
166
[[nodiscard]] T get () const {
167
167
try {
168
168
return data_.get <T>();
169
- } catch (nlohmann::detail ::type_error&) {
169
+ } catch (Json ::type_error&) {
170
170
throw_wrong_type ();
171
171
}
172
172
}
@@ -180,9 +180,9 @@ class Conf {
180
180
[[nodiscard]] T get (const std::string& key) const {
181
181
try {
182
182
return data_.at (key).get <T>();
183
- } catch (nlohmann::detail ::out_of_range&) {
183
+ } catch (Json ::out_of_range&) {
184
184
throw_missing (key);
185
- } catch (nlohmann::detail ::type_error&) {
185
+ } catch (Json ::type_error&) {
186
186
throw_wrong_type (key);
187
187
}
188
188
}
@@ -191,9 +191,9 @@ class Conf {
191
191
[[nodiscard]] T get (const JsonPointer& key) const {
192
192
try {
193
193
return data_.at (key).get <T>();
194
- } catch (nlohmann::detail ::out_of_range&) {
194
+ } catch (Json ::out_of_range&) {
195
195
throw_missing (key.to_string ());
196
- } catch (nlohmann::detail ::type_error&) {
196
+ } catch (Json ::type_error&) {
197
197
throw_wrong_type (key.to_string ());
198
198
}
199
199
}
@@ -214,7 +214,7 @@ class Conf {
214
214
}
215
215
try {
216
216
return data_.at (key).get <T>();
217
- } catch (nlohmann::detail ::type_error&) {
217
+ } catch (Json ::type_error&) {
218
218
throw_wrong_type (key);
219
219
}
220
220
}
@@ -223,9 +223,9 @@ class Conf {
223
223
[[nodiscard]] T get_or (const JsonPointer& key, T def) const {
224
224
try {
225
225
return data_.at (key).get <T>();
226
- } catch (nlohmann::detail ::out_of_range&) {
226
+ } catch (Json ::out_of_range&) {
227
227
return def;
228
- } catch (nlohmann::detail ::type_error&) {
228
+ } catch (Json ::type_error&) {
229
229
throw_wrong_type (key.to_string ());
230
230
}
231
231
}
@@ -252,7 +252,7 @@ class Conf {
252
252
void with (const JsonPointer& key, std::function<void (const T&)> fn) const {
253
253
try {
254
254
fn (get<T>(key));
255
- } catch (nlohmann::detail ::out_of_range&) {
255
+ } catch (Json ::out_of_range&) {
256
256
return ;
257
257
}
258
258
}
@@ -278,9 +278,9 @@ class Conf {
278
278
void try_from (const JsonPointer& key, T& val) const {
279
279
try {
280
280
val = data_.at (key).get <T>();
281
- } catch (nlohmann::detail ::out_of_range& e) {
281
+ } catch (Json ::out_of_range& e) {
282
282
return ;
283
- } catch (nlohmann::detail ::type_error& e) {
283
+ } catch (Json ::type_error& e) {
284
284
throw_wrong_type (key.to_string ());
285
285
}
286
286
}
0 commit comments