@@ -35,7 +35,7 @@ void Config::setParam(const std::string &path,
3535 auto it = accessors.find (path);
3636 if (it == accessors.end ())
3737 throw std::logic_error (
38- " invalid config parameter: " + path );
38+ path + " / " + value + " : invalid config parameter " );
3939 it->second .set (*setter, value);
4040 }
4141}
@@ -49,7 +49,7 @@ std::string Config::getParam(const std::string &path) const
4949 auto it = accessors.find (path);
5050 if (it == accessors.end ())
5151 throw std::logic_error (
52- " invalid config parameter: " + path );
52+ path + " : invalid config parameter" );
5353 return it->second .get (setter->getOptions ());
5454 }
5555}
@@ -118,14 +118,16 @@ void Config::setChannelParam(const std::string &path,
118118 Conv::parse<OptionalChannelExtrema>(value));
119119 }
120120 else
121- throw std::logic_error (" invalid range setting" );
121+ throw std::logic_error (
122+ path + " /" + value + " : invalid range setting" );
122123 }
123124 else if (property == " labelLevel" ) {
124125 setter->setLabelLevel (id, Conv::parse<uint64_t >(value));
125126 }
126127 else
127128 throw std::logic_error (
128- " invalid channel parameter: " + property);
129+ path + " /" + value
130+ + " : invalid channel parameter: " + property);
129131}
130132
131133std::string Config::getChannelParam (const std::string &path) const
@@ -136,9 +138,7 @@ std::string Config::getChannelParam(const std::string &path) const
136138
137139 auto &channel = setter->getOptions ().getChannels ().at (id);
138140
139- if (property == " title" ) {
140- return Conv::toString (channel.title );
141- }
141+ if (property == " title" ) { return Conv::toString (channel.title ); }
142142 else if (property == " axis" ) {
143143 return Conv::toString (channel.axisLine );
144144 }
@@ -175,14 +175,13 @@ std::string Config::getChannelParam(const std::string &path) const
175175 }
176176 else
177177 throw std::logic_error (
178- " invalid range parameter: " + path );
178+ path + " : invalid range parameter" );
179179 }
180180 else if (property == " labelLevel" ) {
181181 return Conv::toString (channel.labelLevel );
182182 }
183183 else
184- throw std::logic_error (
185- " invalid channel parameter: " + property);
184+ throw std::logic_error (path + " : invalid channel parameter" );
186185}
187186
188187std::list<std::string> Config::listChannelParams ()
@@ -236,7 +235,7 @@ Config::Accessors Config::initAccessors()
236235 [](const Options &options)
237236 {
238237 auto cs{options.polar ? CoordSystem::polar
239- : CoordSystem::cartesian};
238+ : CoordSystem::cartesian};
240239 return Conv::toString (cs);
241240 },
242241 .set =
@@ -263,8 +262,7 @@ Config::Accessors Config::initAccessors()
263262 {.get =
264263 [](const Options &options)
265264 {
266- return Conv::toString (
267- options.shapeType );
265+ return Conv::toString (options.shapeType );
268266 },
269267 .set =
270268 [](OptionsSetter &setter, const std::string &value)
@@ -276,9 +274,8 @@ Config::Accessors Config::initAccessors()
276274 {.get =
277275 [](const Options &options)
278276 {
279- auto res (options.horizontal
280- ? Orientation::horizontal
281- : Orientation::vertical);
277+ auto res (options.horizontal ? Orientation::horizontal
278+ : Orientation::vertical);
282279 return Conv::toString (res);
283280 },
284281 .set =
@@ -293,8 +290,7 @@ Config::Accessors Config::initAccessors()
293290 {.get =
294291 [](const Options &options)
295292 {
296- auto res (options.sorted ? Sort::byValue
297- : Sort::none);
293+ auto res (options.sorted ? Sort::byValue : Sort::none);
298294 return Conv::toString (res);
299295 },
300296 .set =
@@ -308,7 +304,8 @@ Config::Accessors Config::initAccessors()
308304 {.get =
309305 [](const Options &options)
310306 {
311- return Conv::toString (static_cast <bool >(options.reverse ));
307+ return Conv::toString (
308+ static_cast <bool >(options.reverse ));
312309 },
313310 .set =
314311 [](OptionsSetter &setter, const std::string &value)
@@ -325,14 +322,16 @@ Config::Accessors Config::initAccessors()
325322 .set =
326323 [](OptionsSetter &setter, const std::string &value)
327324 {
328- setter.setAlign (Conv::parse<Base::Align::Type>(value));
325+ setter.setAlign (
326+ Conv::parse<Base::Align::Type>(value));
329327 }}});
330328
331329 res.insert ({" split" ,
332330 {.get =
333331 [](const Options &options)
334332 {
335- return Conv::toString (static_cast <bool >(options.splitted ));
333+ return Conv::toString (
334+ static_cast <bool >(options.splitted ));
336335 },
337336 .set =
338337 [](OptionsSetter &setter, const std::string &value)
@@ -350,7 +349,8 @@ Config::Accessors Config::initAccessors()
350349 .set =
351350 [](OptionsSetter &setter, const std::string &value)
352351 {
353- setter.showTooltip (Conv::parse<std::optional<int >>(value));
352+ setter.showTooltip (
353+ Conv::parse<std::optional<int >>(value));
354354 }}});
355355
356356 return res;
0 commit comments