ably / ably-flutter

A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.
https://ably.com/download
Apache License 2.0
60 stars 16 forks source link

Expose `href` from `ErrorInfo` in bubbled exceptions #441

Closed QuintinWillison closed 2 years ago

QuintinWillison commented 2 years ago

We have had a customer report getting this exception when making a call to get message history:

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: AblyException: java.lang.Exception: action not permitted, app = NMIcRg (40160 ). Error thrown null.
       at Platform.invokePlatformMethod(platform.dart:50)
       at PlatformObject.invokeRequest(platform_object.dart:66)
       at RealtimeChannel.history(realtime_channel.dart:53)
       at AblyOfficialPlugin._syncHistory(ably_official_plugin.dart:586)

@mattheworiordan asked in this internal Slack thread:

Do you know if it’s possible to include the error URL in these messages? If so, they would have been taken to https://help.ably.io/error/40160, and had a better developer experience.

To which @QuintinWillison responded with:

Related, I included REST: Support Hyperlink on Request Failure here: https://github.com/ably/features/pull/63 The Android SDK does offer the href member on ErrorInfo (TI4) but we will need to dig deeper into both the Java and Flutter codebases to work out where/whether it gets bubbled up meaningfully enough. It also relates closely to TI5 also, though that talks about "log entries" which is not that helpful. In this scenario, the actual log entry is presumably written or the exception is otherwise caught by the application code. So we may be more describing requirements of toString-like implementations down the stack. :thinking_face:

Creating this issue here, because it's in using this SDK for an Android app that we've had a customer experience pain here, however I suspect that most of the work to fix this may well be in our underlying Java/Android SDK.