Skip to content

Generic error code returned with readFile on iOS when file doesn't exist #56

@lightning1377

Description

@lightning1377

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 7.4.4
  @capacitor/core: 7.4.4
  @capacitor/android: 7.4.4
  @capacitor/ios: 7.4.4

Installed Dependencies:

  @capacitor/cli: 7.1.0
  @capacitor/core: 7.1.0
  @capacitor/android: 7.1.0
  @capacitor/ios: 7.1.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Platform(s)

iOS

Current Behavior

Try to read a file which doesn't exist using readFile method, results in error with:

  • code = OS-PLUG-FILE-0013
  • errorMessage = 'readFile' failed with: The file “test” couldn’t be opened because there is no such file.

note: the message seems to be localized on iOS, so we can't test with message either (in order to ignore file read errors when the file doesn't exist)

Expected Behavior

Should return error code OS-PLUG-FILE-0008 as written in this plugin's documentation: https://www.npmjs.com/package/@capacitor/filesystem#errors

Code Reproduction

Other Technical Details

@capacitor/filesystem plugin version: 7.1.5

Additional Context

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