mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-27 06:19:51 -05:00
Have the documentation print out more information if an error occurs
Add other scene files (commented out) to the openspace.cfg
This commit is contained in:
@@ -68,6 +68,32 @@ std::string to_string(std::string value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
std::string to_string(openspace::documentation::TestResult testResult) {
|
||||
using namespace openspace::documentation;
|
||||
|
||||
if (testResult.success) {
|
||||
return "Success";
|
||||
}
|
||||
else {
|
||||
std::stringstream stream;
|
||||
stream << "Failure." << '\n';
|
||||
|
||||
for (const TestResult::Offense& offense : testResult.offenses) {
|
||||
stream << " " << std::to_string(offense) << '\n';
|
||||
}
|
||||
|
||||
for (const TestResult::Warning& warning : testResult.warnings) {
|
||||
stream << " " << std::to_string(warning) << '\n';
|
||||
}
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
}
|
||||
|
||||
std::string to_string(openspace::documentation::TestResult::Offense offense) {
|
||||
return offense.offender + ": " + std::to_string(offense.reason);
|
||||
}
|
||||
|
||||
std::string to_string(openspace::documentation::TestResult::Offense::Reason reason) {
|
||||
switch (reason) {
|
||||
case openspace::documentation::TestResult::Offense::Reason::ExtraKey:
|
||||
@@ -85,6 +111,10 @@ std::string to_string(openspace::documentation::TestResult::Offense::Reason reas
|
||||
}
|
||||
}
|
||||
|
||||
std::string to_string(openspace::documentation::TestResult::Warning warning) {
|
||||
return warning.offender + ": " + std::to_string(warning.reason);
|
||||
}
|
||||
|
||||
std::string to_string(openspace::documentation::TestResult::Warning::Reason reason) {
|
||||
switch (reason) {
|
||||
case openspace::documentation::TestResult::Warning::Reason::Deprecated:
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
|
||||
#include <regex>
|
||||
|
||||
namespace openspace {
|
||||
@@ -364,6 +366,14 @@ int addSceneGraphNode(lua_State* L) {
|
||||
}
|
||||
|
||||
OsEng.renderEngine().scene()->initializeNode(node);
|
||||
}
|
||||
catch (const documentation::SpecificationError& e) {
|
||||
return luaL_error(
|
||||
L,
|
||||
"Error loading scene graph node: %s: %s",
|
||||
e.what(),
|
||||
std::to_string(e.result).c_str()
|
||||
);
|
||||
} catch (const ghoul::RuntimeError& e) {
|
||||
return luaL_error(L, "Error loading scene graph node: %s", e.what());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user