cph-cachet / carp.sensing-flutter

CARP Mobile Sensing for Flutter, including mobile sensing framework, data backend support, and the CARP mobile sensing app.
MIT License
80 stars 28 forks source link

_stopAudioRecording tries to return an exception as a future #21

Closed nightscape closed 5 years ago

nightscape commented 5 years ago

When _stopAudioRecording catches an exception (in my case Recorder already stopped), it tries to return this exception as a future which itself fails: https://github.com/cph-cachet/carp.sensing-flutter/blob/5001c61c6079eb467a18a4cf24e18f821f636cf1/carp_audio_package/lib/audio_probe.dart#L86 One possible solution to this would be to use Future.sync and rethrow the error instead of returning it: https://www.dartlang.org/guides/libraries/futures-error-handling#solution-using-futuresync-to-wrap-your-code

bardram commented 5 years ago

I've released a version 0.3.3 of this sensing package with the suggested fix. Thanks for the hint.