Made sure that SQL errors make it to the client.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3867 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-04-18 00:24:00 +00:00
parent 11ad344e52
commit 804359d12e
6 changed files with 53 additions and 36 deletions

View File

@ -130,17 +130,15 @@ bool tf_util_report_error(JSContext* context, JSValue value)
}
else if (JS_IsException(value))
{
js_std_dump_error(context);
JSValue exception = JS_GetException(context);
const char* string = JS_ToCString(context, exception);
printf("Exception: %s\n", string);
JS_FreeCString(context, string);
tf_task_t* task = tf_task_get(context);
if (task)
{
tf_task_send_error_to_parent(task, exception);
tf_task_send_error_to_parent(task, value);
}
else
{
js_std_dump_error(context);
}
JS_FreeValue(context, exception);
is_error = true;
}
return is_error;