-
Notifications
You must be signed in to change notification settings - Fork 7.6k
NativeFileSystem APIs pass inconsistent types to error handlers #2057
Comments
Reviewed |
Hi, I was looking at this, and it looks like the error callbacks are all being called with a FileError. What seems to be wrong is the jsdoc in /**
* Converts a brackets.fs.ERR_* error code to a FileError.* error code
* @param {number} nativeErr
* @return {number}
*/
_nativeToFileError: function (nativeErr) {
var error;
[...]
return new NativeFileSystem.FileError(error);
} @peterflynn Is it possible that this caused the confussion, or am I missing something? |
Another thing is that looking at the specs there are some difference between the draft originally used in the implementation of In the old one, ErrorCallback was supposed to receive a FileError, but that interface seems to have been deprecated in the currents specs and it expects a DomError instead. Mozilla already dropped FileError as of Firefox 13.0, though I haven't been able to find any information regarding plans for this on Chrome. I guess this is one of the perks of implementing working drafts... should we update |
NativeFileError for error callbacks in NativeFileSystem (#2057)
FBNC @peterflynn |
@jbalsas: sorry about my mistake in the original bug, and thanks for the cleanup in pull #2318! @jasonsanjose: I noticed that resolveNativeFileSystemPath() doesn't follow Chema's new conventions, though. It calls the old conversion function (which no longer exists afaict) and doesn't new up a NativeFileError to wrap the error code in... Shall one of us fix that real quick before closing this? |
@peterflynn About |
Closing now that #2063 has also landed |
The error callbacks passed to various NativeFileSystem APIs are sometimes passed an integer error code, vs. sometimes passed a FileError object containing such an error code. Sometimes even different codepaths through the same method are inconsistent here.
The spec is unambiguous on which one is correct: "the err argument to the ErrorCallback MUST be a DOMError object..."
The text was updated successfully, but these errors were encountered: