forked from cory/tildefriends
Move data/global/settings.json into the database. Improved some error plumbing along the way.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3775 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
13
src/task.c
13
src/task.c
@ -1158,7 +1158,18 @@ void tf_task_reject_promise(tf_task_t* task, promiseid_t promise, JSValue value)
|
||||
promise_t* it = _tf_task_find_promise(task, promise);
|
||||
if (it)
|
||||
{
|
||||
JSValue result = JS_Call(task->_context, it->values[2], JS_UNDEFINED, 1, &value);
|
||||
JSValue arg = value;
|
||||
bool free_arg = false;
|
||||
if (JS_IsException(value))
|
||||
{
|
||||
arg = JS_GetException(task->_context);
|
||||
free_arg = true;
|
||||
}
|
||||
JSValue result = JS_Call(task->_context, it->values[2], JS_UNDEFINED, 1, &arg);
|
||||
if (free_arg)
|
||||
{
|
||||
JS_FreeValue(task->_context, arg);
|
||||
}
|
||||
tf_util_report_error(task->_context, result);
|
||||
JS_FreeValue(task->_context, it->values[1]);
|
||||
JS_FreeValue(task->_context, it->values[2]);
|
||||
|
Reference in New Issue
Block a user