enhance error message in variant
This commit is contained in:
parent
61f2ac4679
commit
9301771405
1 changed files with 2 additions and 2 deletions
|
|
@ -486,7 +486,7 @@ const string& variant::get_string()const
|
||||||
{
|
{
|
||||||
if( get_type() == string_type )
|
if( get_type() == string_type )
|
||||||
return **reinterpret_cast<const const_string_ptr*>(this);
|
return **reinterpret_cast<const const_string_ptr*>(this);
|
||||||
FC_THROW_EXCEPTION( bad_cast_exception, "Invalid cast from ${type} to Object" );
|
FC_THROW_EXCEPTION( bad_cast_exception, "Invalid cast from type '${type}' to Object", ("type",int(get_type())) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -495,7 +495,7 @@ const variant_object& variant::get_object()const
|
||||||
{
|
{
|
||||||
if( get_type() == object_type )
|
if( get_type() == object_type )
|
||||||
return **reinterpret_cast<const const_variant_object_ptr*>(this);
|
return **reinterpret_cast<const const_variant_object_ptr*>(this);
|
||||||
FC_THROW_EXCEPTION( bad_cast_exception, "Invalid cast from ${type} to Object" );
|
FC_THROW_EXCEPTION( bad_cast_exception, "Invalid cast from type '${type}' to Object", ("type",int(get_type())) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void to_variant( const std::string& s, variant& v )
|
void to_variant( const std::string& s, variant& v )
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue