summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorportix <none@none>2013-02-23 13:51:14 +0100
committerportix <none@none>2013-02-23 13:51:14 +0100
commitca0edc249144007571dc54fd432fa2a651d6f53b (patch)
treed9a7bf75eda3391a1b57e25770144b5b53ac6cb0 /scripts
parent75aa886334b0b2da01d2c09185f33ea0d78f1759 (diff)
downloaddwb-ca0edc249144007571dc54fd432fa2a651d6f53b.zip
Check if parameter is an Error in io.debug
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/io.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/scripts/lib/io.js b/scripts/lib/io.js
index 311f8e97..3d731e8b 100644
--- a/scripts/lib/io.js
+++ b/scripts/lib/io.js
@@ -16,18 +16,24 @@
var message = new String();
params = params || {};
var offset = params.offset || 0;
- if (params.message)
- {
- message += prefixMessage + params.message;
+ var error;
+ if (params instanceof Error)
+ error = params;
+ else {
+ if (params.message)
+ {
+ message += prefixMessage + params.message;
+ }
+ if (params.error instanceof Error)
+ error = params.error;
}
- else if (this.path)
- {
+
+ if (this.path)
message += prefixFile + this.path;
- }
- if (params.error && params.error instanceof Error)
+
+ if (error)
{
- var line = params.error.line || params.error.line === 0 ? params.error.line : "?";
- var error = params.error;
+ var line = error.line || error.line === 0 ? error.line : "?";
if (!error.stack)
{
try