I would like a test like this added to the regression suite:
CREATE OR REPLACE FUNCTION v8_test_throw() RETURNS float AS
$$
throw new Error('Error');
$$
LANGUAGE plv8;
CREATE OR REPLACE FUNCTION v8_test_catch_throw() RETURNS json AS
$$
try{
var res = plv8.execute('select * from v8_test_throw()');
} catch(e) {
return {"result": "error"};
}
$$
language plv8;
SELECT v8_test_catch_throw();
This is a regression test to test for issue
http://code.google.com/p/plv8js/issues/detail?id=71
I'm not sure if this affects any other platforms besides windows, but would be
good in place to test. Right now when I test against windows it passes all
current tests.
On a faulty install, this test will crash the postgres service and on a good
install -- will just return:
{"result":"error"}
Original issue reported on code.google.com by reg...@arrival3d.com on 13 Jun 2013 at 1:00
Original issue reported on code.google.com by
reg...@arrival3d.com
on 13 Jun 2013 at 1:00