Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24672] Windows: Catch every exception within async operations

GitHub Issuen/a
TypeStory
PriorityMedium
StatusClosed
ResolutionDone
Resolution Date2017-05-24T22:29:29.000+0000
Affected Version/sRelease 6.1.0
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2017-05-10T08:51:22.000+0000
Updated2017-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.
    }
})

Comments

  1. Kota Iguchi 2017-05-24

    Done with https://github.com/appcelerator/titanium_mobile_windows/pull/1001

JSON Source