From 389c80aece99f95c30662332af31fd113511dce3 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 20 Sep 2009 17:34:27 +0200 Subject: [PATCH] return error from cat_promise in node.fs.cat --- src/file.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file.js b/src/file.js index e02e19a..1b05bf2 100644 --- a/src/file.js +++ b/src/file.js @@ -10,7 +10,9 @@ node.fs.cat = function (path, encoding) { encoding = encoding || "utf8"; - open_promise.addErrback(function () { cat_promise.emitError(); }); + open_promise.addErrback(function () { + cat_promise.emitError(new Error("Could not open " + path)); + }); open_promise.addCallback(function (fd) { var content = (encoding === "raw" ? [] : ""); var pos = 0; -- 2.7.4