This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
NativeFileError for error callbacks in NativeFileSystem (#2057) #2318
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned jasonsanjose
Dec 10, 2012
* @return {number} | ||
* Converts a brackets.fs.ERR_* error code to a NativeFileError.* error name | ||
* @param {!number} nativeErr A brackets.fs error code | ||
* @return {string} An error name out of the possible NativeFileError.* names | ||
*/ | ||
_nativeToFileError: function (nativeErr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this function is a bit misleading now. How about _fsErrorToDOMErrorName
?
Initial review complete. What were the 3 extensions that use |
I've updated the name and its references and pushed the changes. The three extensions I've identified are:
|
@jbalsas Need to merge with master |
…ystem-domerror Conflicts: src/file/NativeFileSystem.js
Done! ;) |
Confirmed unit tests are passing on mac. Merging. |
jasonsanjose
added a commit
that referenced
this pull request
Dec 11, 2012
NativeFileError for error callbacks in NativeFileSystem (#2057)
@davidderaedt, @cfjedimaster and @jrowny: Please see the changes described above. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a possible fix for #2057. It introduces a new
NativeFileError
implementingDOMError
to substitute the currentFileError
as the specs dictate.Important changes
FileError
polyfillNativeFileSystem.FileError
is moved to its own moduleNativeFileError
. I thougth it would make more sense, and avoids dependencies withNativeFileSystem
when only wanting to check error name values._nativeToFileError
has been modified to just convert a brackets.fs error code to a NativeFileError error name. Hopefully this clears out any confusion in NativeFileSystem by making explicit all the error constructors in the same way.DOMError
has aname
attribute whereFileError
hadcode
.Notes
FileError
, nor the need to use a polyfill for the in-browser branch.DOMError
andFileError
may break error handling in existing extensions. We could add acode
attribute in ourNativeFileError
class to ensure backward compatibility. I've done a quick search though, and only three extensions seem to be using error.code right now.