basho / erlang_js

A linked-in driver for Erlang to Mozilla's Spidermonkey Javascript runtime.
Apache License 2.0
238 stars 88 forks source link

Bz1041 nested error properties #6

Closed kellymclaughlin closed 13 years ago

kellymclaughlin commented 13 years ago

This is to address bz 1041. Instead of scanning the entire return value from the sm_eval function for an error property, an error condition is only triggered if sm_eval returns a string that begins with: {"error" or is a list containing single notfound error tuple as follows: [{"error":"notfound"}]

The latter case is probably unnecessary since notfound errors are not currently passed to javascript functions, but there was an existing test case for that condition and to avoid any unintended consequences I elected to maintain the current behavior and keep the test passing.

slfritchie commented 13 years ago

+1 to merge