mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
change message in exception
This commit is contained in:
@@ -803,7 +803,7 @@ void from_toml(T& x, const toml::value& v)
|
|||||||
{
|
{
|
||||||
if(v.type() != vT)
|
if(v.type() != vT)
|
||||||
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
||||||
std::string(" is not type of arguemnt: ") + stringize(vT));
|
std::string(" is not arguemnt type: ") + stringize(vT));
|
||||||
x = v.cast<vT>();
|
x = v.cast<vT>();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -817,7 +817,7 @@ void from_toml(T& x, const toml::value& v)
|
|||||||
// TODO the case of x is not dynamic container case
|
// TODO the case of x is not dynamic container case
|
||||||
if(v.type() != value_t::Array)
|
if(v.type() != value_t::Array)
|
||||||
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
||||||
std::string(" is not type of argument type Array"));
|
std::string(" is not argument type: Array"));
|
||||||
const auto& ar = v.cast<value_t::Array>();
|
const auto& ar = v.cast<value_t::Array>();
|
||||||
for(const auto& val : ar)
|
for(const auto& val : ar)
|
||||||
{
|
{
|
||||||
@@ -835,7 +835,7 @@ void from_toml(T& x, const toml::value& v)
|
|||||||
{
|
{
|
||||||
if(v.type() != value_t::Table)
|
if(v.type() != value_t::Table)
|
||||||
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
||||||
std::string(" is not type of argument type Table"));
|
std::string(" is not argument type: Table"));
|
||||||
x.clear();
|
x.clear();
|
||||||
const auto& tb = v.cast<value_t::Table>();
|
const auto& tb = v.cast<value_t::Table>();
|
||||||
for(const auto& kv : tb)
|
for(const auto& kv : tb)
|
||||||
@@ -861,7 +861,7 @@ T get(const toml::value& v)
|
|||||||
{
|
{
|
||||||
if(v.type() != value_t::Array)
|
if(v.type() != value_t::Array)
|
||||||
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
||||||
std::string(" is not type of argument type Array"));
|
std::string(" is not argument type: Array"));
|
||||||
T tmp;
|
T tmp;
|
||||||
from_toml(tmp, v);
|
from_toml(tmp, v);
|
||||||
return tmp;
|
return tmp;
|
||||||
@@ -874,7 +874,7 @@ T get(const toml::value& v)
|
|||||||
{
|
{
|
||||||
if(v.type() != value_t::Table)
|
if(v.type() != value_t::Table)
|
||||||
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
throw type_error("from_toml: value type: " + stringize(v.type()) +
|
||||||
std::string(" is not type of argument type Table"));
|
std::string(" is not argument type: Table"));
|
||||||
T tmp;
|
T tmp;
|
||||||
from_toml(tmp, v);
|
from_toml(tmp, v);
|
||||||
return tmp;
|
return tmp;
|
||||||
|
Reference in New Issue
Block a user