diff options
author | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-02-22 09:31:21 +0200 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-03-13 11:58:27 +0200 |
commit | 7d1911572000d1353c1c0109402431323fcd8639 (patch) | |
tree | 4881a1e159415cd796e255bec951a7bb32b23ee8 /platform/android/src/native_map_view.cpp | |
parent | 565792606d5d03d0cc9889f112bb50345c899005 (diff) | |
download | qtlocation-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 'platform/android/src/native_map_view.cpp')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 2f23f0b7d9..83a158efa9 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -164,13 +164,12 @@ void NativeMapView::onDidFinishLoadingMap() { } } -void NativeMapView::onDidFailLoadingMap(std::exception_ptr exceptionPtr) { +void NativeMapView::onDidFailLoadingMap(MapLoadError, const std::string& error) { assert(vm != nullptr); android::UniqueEnv _env = android::AttachEnv(); static auto& javaClass = jni::Class<NativeMapView>::Singleton(*_env); static auto onDidFailLoadingMap = javaClass.GetMethod<void (jni::String)>(*_env, "onDidFailLoadingMap"); - std::string error = mbgl::util::toString(exceptionPtr); auto weakReference = javaPeer.get(*_env); if (weakReference) { weakReference.Call(*_env, onDidFailLoadingMap, jni::Make<jni::String>(*_env, error)); |