Skip to content

Rework error handling for synchronous file system module API #6260

@manoldonev

Description

@manoldonev

Currently the error handling for the synchronous file system module API is performed via optional error callbacks that are passed as last parameter to the respective "sync" method. This approach is rather unconventional and unintuitive:

file.writeTextSync("some text", (err) => console.log(err));

Rework the error handling logic for the "sync" methods to be similar to the nodejs approach with try...catch blocks:

try {
    file.writeTextSync("some text");
} catch (err) {
    console.log(err);
}

Related to https://github.com/NativeScript/docs/issues/1111


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions