Commit 5b1eea97 5b1eea97852890ce75ce968e67caa985875642c4 by Nicolas Perriault

refs #159 - better error message in case getGlobal() failed

1 parent 7145ddd7
......@@ -733,7 +733,9 @@ Casper.prototype.getGlobal = function getGlobal(name) {
}
return result;
}, {'name': name});
if ('error' in result) {
if (typeof result !== "object") {
throw new CasperError(f('Could not retrieve global value for "%s"', name));
} else if ('error' in result) {
throw new CasperError(result.error);
} else if (utils.isString(result.value)) {
return JSON.parse(result.value);
......