diff options
Diffstat (limited to 'platform/default/asset_file_source.cpp')
-rw-r--r-- | platform/default/asset_file_source.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/platform/default/asset_file_source.cpp b/platform/default/asset_file_source.cpp index 3063bf88a0..0b57a6dcef 100644 --- a/platform/default/asset_file_source.cpp +++ b/platform/default/asset_file_source.cpp @@ -44,12 +44,10 @@ public: } else if (result == -1 && errno == ENOENT) { response.error = std::make_unique<Response::Error>(Response::Error::Reason::NotFound); } else { - try { - response.data = std::make_shared<std::string>(util::read_file(path)); - } catch (...) { + response.data = util::readFile(path); + if (!response.data) { response.error = std::make_unique<Response::Error>( - Response::Error::Reason::Other, - util::toString(std::current_exception())); + Response::Error::Reason::Other, "Cannot read file " + path); } } |