Skip to content

Commit

Permalink
Introduces gpf.fs.read for all hosts (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Oct 14, 2017
1 parent e5b8915 commit 625946e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/fs/phantomjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
/*#endif*/

_gpfFsReadImplByHost[_GPF_HOST.PHANTOMJS] = function (path) {
return new Promise(function (resolve) {
resolve(_gpfNodeFs.read(path));
return new Promise(function (resolve, reject) {
try {
resolve(_gpfNodeFs.read(path));
} catch (e) {
// Error is a string
reject(new Error(e));
}
});
};

0 comments on commit 625946e

Please sign in to comment.