add more info to message when exeception is raised while enabling model attributes

This commit is contained in:
ohsqueezy 2023-07-23 20:01:45 -04:00
parent f9d171626f
commit 67c3e193f4
2 changed files with 4 additions and 4 deletions

View File

@ -24,9 +24,9 @@ GLint sb::Attributes::index() const
catch (const std::bad_variant_access&)
{
std::ostringstream message;
message << "Trying to get index for " << dimensions() << "D " << size() << "b attributes, but no index has been set yet. Assign an"
<< " index with glBindAttribLocation and copy it to Attributes::index(GLint) or look up the index automatically at bind time by"
<< " passing the location name and linked shader program index to Attributes::bind(const std::string&, GLuint).";
message << "Trying to get index for " << *this << ", but no index has been set yet. Assign an index with glBindAttribLocation and"
<< " copy it to Attributes::index(GLint) or look up the index automatically at bind time by passing the location name and"
<< " linked shader program index to Attributes::bind(const std::string&, GLuint).";
throw std::runtime_error(message.str());
}
}

View File

@ -85,7 +85,7 @@ void sb::Model::enable() const
catch (const std::runtime_error& error)
{
std::ostringstream message;
message << "Error enabling " << attributes.first << " attributes on model";
message << "Error enabling " << attributes.first << " attributes on model: " << error.what();
throw std::runtime_error(message.str());
}
}