From 67c3e193f4dce9280425218c4d5caeb42ce86bb6 Mon Sep 17 00:00:00 2001 From: frank Date: Sun, 23 Jul 2023 20:01:45 -0400 Subject: [PATCH] add more info to message when exeception is raised while enabling model attributes --- src/Attributes.cpp | 6 +++--- src/Model.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Attributes.cpp b/src/Attributes.cpp index b52e5fb..4d6592f 100644 --- a/src/Attributes.cpp +++ b/src/Attributes.cpp @@ -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()); } } diff --git a/src/Model.cpp b/src/Model.cpp index b52aff0..4c31d75 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -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()); } }