Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Exceptions swallowed by promises #17

@hgwood

Description

@hgwood

Reprising your sample and introducing an obvious mistake shows that errors don't seem to escape promise handlers:

var uwp = require('uwp');
uwp.projectNamespace("Windows");

Windows.Storage.KnownFolders.documentsLibrary.createFileAsync(
  "sample.dat", Windows.Storage.CreationCollisionOption.replaceExisting)
  .done(
    function (file) {
      undefinedFunc();
    },
    function (error) {
      undefinedFunc();
    }
);

Running this shows no error, it just runs eternally because uwp.close() is never called. It makes it hard to detect errors, especially programming ones.

I read about WinJS.promise.onerror, but I'm not sure how it relates to the uwp module. Any pointers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions