summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-02-22 09:31:21 +0200
committerAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-03-13 11:58:27 +0200
commit7d1911572000d1353c1c0109402431323fcd8639 (patch)
tree4881a1e159415cd796e255bec951a7bb32b23ee8 /include
parent565792606d5d03d0cc9889f112bb50345c899005 (diff)
downloadqtlocation-mapboxgl-7d1911572000d1353c1c0109402431323fcd8639.tar.gz
[core] Don't use exceptions in MapObserver::onDidFailLoadingMap
Using different exception pointers to specify the loading failure makes an awkward API. Most users rethrow the exception only to figure out what type of error happened so it can be reported properly. So replace the exception pointer with a enum an string description of the failure.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/map_observer.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/mbgl/map/map_observer.hpp b/include/mbgl/map/map_observer.hpp
index 98b218f8f0..8ad9e93d0b 100644
--- a/include/mbgl/map/map_observer.hpp
+++ b/include/mbgl/map/map_observer.hpp
@@ -3,11 +3,17 @@
#include <mbgl/style/source.hpp>
#include <cstdint>
-#include <exception>
#include <string>
namespace mbgl {
+enum class MapLoadError {
+ StyleParseError,
+ StyleLoadError,
+ NotFoundError,
+ UnknownError,
+};
+
class MapObserver {
public:
virtual ~MapObserver() = default;
@@ -32,7 +38,7 @@ public:
virtual void onCameraDidChange(CameraChangeMode) {}
virtual void onWillStartLoadingMap() {}
virtual void onDidFinishLoadingMap() {}
- virtual void onDidFailLoadingMap(std::exception_ptr) {}
+ virtual void onDidFailLoadingMap(MapLoadError, const std::string&) {}
virtual void onWillStartRenderingFrame() {}
virtual void onDidFinishRenderingFrame(RenderMode) {}
virtual void onWillStartRenderingMap() {}