mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Better exception message
This commit is contained in:
parent
970a8e3ecc
commit
6c278fee61
@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <Common/SettingsChanges.h>
|
||||
#include <Common/FieldVisitors.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -91,7 +93,16 @@ Field SettingsCollection<Derived>::const_reference::getValue() const
|
||||
template <class Derived>
|
||||
Field SettingsCollection<Derived>::valueToCorrespondingType(size_t index, const Field & value)
|
||||
{
|
||||
return members()[index].value_to_corresponding_type(value);
|
||||
try
|
||||
{
|
||||
return members()[index].value_to_corresponding_type(value);
|
||||
}
|
||||
catch (Exception & e)
|
||||
{
|
||||
e.addMessage(fmt::format("in attempt to set the value of setting to {}",
|
||||
applyVisitor(FieldVisitorToString(), value)));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -982,7 +982,16 @@ void Context::setSetting(const StringRef & name, const Field & value)
|
||||
|
||||
void Context::applySettingChange(const SettingChange & change)
|
||||
{
|
||||
setSetting(change.name, change.value);
|
||||
try
|
||||
{
|
||||
setSetting(change.name, change.value);
|
||||
}
|
||||
catch (Exception & e)
|
||||
{
|
||||
e.addMessage(fmt::format("in attempt to set the value of setting '{}' to {}",
|
||||
change.name, applyVisitor(FieldVisitorToString(), change.value)));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user