[TIMOB-24672] Windows: Catch every exception within async operations
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | Medium |
Status | Closed |
Resolution | Done |
Resolution Date | 2017-05-24T22:29:29.000+0000 |
Affected Version/s | Release 6.1.0 |
Fix Version/s | n/a |
Components | Windows |
Labels | n/a |
Reporter | Kota Iguchi |
Assignee | Kota Iguchi |
Created | 2017-05-10T08:51:22.000+0000 |
Updated | 2017-05-24T22:29:44.000+0000 |
Description
We should make sure to catch every exception that is happening within async operations.
Typically it's going to look like below.
concurrency::create_task(object__->DoSomethingAsync()).then([](concurrency::task<void> task)({
try {
task.get();
} catch (Platform::Exception^ e) {
// we might want to log error message, but
// we should not throw exception inside async operations.
// we might want to log error message and HRESULT too
} catch (...) {
// we might want to log this, but
// we should not throw exception inside async operations.
}
})
Done with https://github.com/appcelerator/titanium_mobile_windows/pull/1001