You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
* bump to 0.10.8
* Update PULL_REQUEST_TEMPLATE
* Fix#468 "Messy error returns: Sometimes a string, sometimes an Error object"
* Cleanup: remove an unused constant and duplicate method definitions
* Cleanup:
- fix minor errors in JSDoc comments, for example {string]} => {string}
- fix parameter name "encode" => "encoding" (more logical, and it says so in the function's JSDoc too)
- json-stream.js: split a looooong log message string constant into two parts and fix a typo ("maually"), and the type for objects is "Object" (capitalized) in Flow type annotations
* Fix a (Flow) type conflict - fixes issue #461
* NEEDS REVIEW - Attempt to fix some of issue #460 (Error message normalization)
Error messages reported by iOS and Android versions should be as similar as possible. Also, within the same system there should be consistency. This patch is an attempt to bring a LITTLE more of this consistency to the error messages. I also fixed some very few minor language issues, like "does not exist" (is the correct English). I tried keeping the changes to a minimum.
Background: In my project code I want to know when a file already exists (e.g. after calling fs.createFile), and the only way is to check the error message string that I get. It's bad if they differ between versions (createFileASCII and createFile) and then also between Android and iOS version. At least some core part of the string should be the same, so that I have something to match.
Ideally messages should come from a centralized easy (easier) to maintain file (for both iOS and Android), and ideally both systems should have the same errors and messages as far as possible.
emitStreamEvent(streamId, "warn", "Failed to convert data to "+encoding+" encoded string, this might due to the source data is not able to convert using this encoding.");
312
+
emitStreamEvent(streamId, "warn", "Failed to convert data to " + encoding +
313
+
" encoded string, this might due to the source data is not able to convert using this encoding.");
callback.invoke("source file : " + data + " does not exist");
713
715
return ;
714
716
}
715
717
FileInputStreamfin = newFileInputStream(src);
716
718
OutputStreamostream = newFileOutputStream(dest);
717
-
byte[] buffer = newbyte[10240];
719
+
byte[] buffer = newbyte[10240];
718
720
intread = fin.read(buffer);
719
-
while(read > 0) {
721
+
while(read > 0) {
720
722
ostream.write(buffer, 0, read);
721
723
read = fin.read(buffer);
722
724
}
723
725
fin.close();
724
726
ostream.close();
725
-
}
726
-
else {
727
+
} else {
727
728
if (!created) {
728
-
callback.invoke("create file error: failed to create file at path `" + path + "` for its parent path may not exists, or the file already exists. If you intended to overwrite the existing file use fs.writeFile instead.");
729
+
callback.invoke("failed to create new file at path `" + path + "` because its parent path " +
730
+
"may not exist, or the file already exists. If you intended to overwrite the " +
0 commit comments