namespace Msp {
namespace GL {
+resource_load_error::resource_load_error(const string &name, const string &err):
+ runtime_error(format("%s: %s", name, err))
+{ }
+
resource_load_error::resource_load_error(const string &name, const exception &exc):
runtime_error(format("%s: %s: %s", name, Debug::demangle(typeid(exc).name()), exc.what()))
{ }
void ResourceManager::ManagedResource::start_loading()
{
io = location.collection->open_raw(location.name);
+ if(!io)
+ throw resource_load_error(location.name, "open failed");
+
loader = resource->load(*io);
if(!loader)
{
class resource_load_error: public std::runtime_error
{
public:
+ resource_load_error(const std::string &, const std::string &);
resource_load_error(const std::string &, const std::exception &);
virtual ~resource_load_error() throw() { }
};