Name
FileError — error while reading a file
Synopsis
A FileError object represents an error that occurred when
reading a file with FileReader or FileReaderSync. If the synchronous API is used, the
FileError object is thrown. If the asynchronous API is used, the
FileError object is the value of the error property of the FileReader object
when the error event is dispatched.
Note that the FileWriter API (which is described in The Filesystem API, but is not stable enough to document in this reference section) adds new error code constants to this object.
Constants
The FileError error codes are the following:
unsigned shortNOT_FOUND_ERR= 1The file does not exist. (Perhaps it was deleted after the user selected it, but before your program attempted to read it.)
unsigned shortSECURITY_ERR= 2Unspecified security issues prevent the browser from allowing your code to read the file.
unsigned shortABORT_ERR= 3The attempt to read the file was aborted.
unsigned shortNOT_READABLE_ERR= 4The file is not readable, perhaps because its permissions have changed or because another process has locked it.
unsigned shortENCODING_ERR= 5A call to
readAsDataURL()failed because the file was too long to encode in adata://URL.
Properties
readonly unsigned shortcodeThis property specifies what kind of error occurred. Its value is one of the constants above.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access