Skip to content

IOS: broken file is saved on 404 error #426

@mhazda-eleks

Description

@mhazda-eleks

Hello all,

I am facing next issue with react-native-blob-util : If you provide link to the file that doesn't exist 404 error will be thrown and in catch block despite calling fs.unlink() broken file will be created.

Code example:

try {
      const task = ReactNativeBlobUtil.config({
        path: destination,
        IOSBackgroundTask: true,
      }).fetch(GET, url);

      const res = await task;

      if (res.info().status !== 200) {
        throw error;
      }

      return res.path();
    } catch (error: any) {

       await fs.unlink(destination); // this will not work

}

Could you please advise on this issue.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions