Skip to content

Cannot catch exception thrown by File.WriteAllBytesAsync #491

@JerrettDavis

Description

@JerrettDavis

When attempting to use IFile.WriteAllBytesAsync, all underlying exceptions from File.WriteAllBytesAsync are quietly disregarded. I can see the exceptions being thrown, but a try/catch fails to catch the exceptions. Instead, the program continues execution on the next line. I believe this is due to the FileWrapper not awaiting the response from File.WriteAllBytes, and instead it's always returning a Task.Completed task.

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