[core] Rationalize error handling for resource loading
* Standardize on std::exception_ptr as the error representation (fixes #2854). * Don't format textual strings at the error source; pass on the constituent data via observer method parameters instead. * Use the null object pattern to simplify observer notification code. * Further refactoring for ResourceLoading tests.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/map/tile_data.hpp>
|
||||
#include <mbgl/renderer/debug_bucket.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -26,7 +27,10 @@ const char* TileData::StateToString(const State state) {
|
||||
void TileData::dumpDebugLogs() const {
|
||||
Log::Info(Event::General, "TileData::id: %s", std::string(id).c_str());
|
||||
Log::Info(Event::General, "TileData::state: %s", TileData::StateToString(state));
|
||||
Log::Info(Event::General, "TileData::error: %s", error.c_str());
|
||||
|
||||
if (error) {
|
||||
Log::Info(Event::General, "TileData::error: %s", util::toString(error).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user