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:
2022-01-18 02:50:46 +00:00
parent 0b5017b208
commit 1515525a1b
3 changed files with 37 additions and 13 deletions

View File

@ -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]);