Source
if (NULL != (env = zbx_es_get_env(ctx)) && NULL != es_obj_get_data(env, wd->browser, ES_OBJ_BROWSER))
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/******************************************************************************
* *
* Purpose: browser error constructor *
* *
******************************************************************************/
static duk_ret_t es_browser_error_ctor(duk_context *ctx)
{
if (!es_is_chained_constructor_call(ctx))
return DUK_RET_TYPE_ERROR;
duk_push_this(ctx);
duk_dup(ctx, 0);
duk_put_prop_string(ctx, -2, "message");
duk_dup(ctx, 1);
duk_put_prop_string(ctx, -2, "browser");
return 0;
}
/******************************************************************************
* *
* Purpose: webdriver error constructor *
* *
******************************************************************************/
static duk_ret_t es_webdriver_error_ctor(duk_context *ctx)
{
if (!duk_is_constructor_call(ctx))
return DUK_RET_TYPE_ERROR;
return es_super(ctx, "BrowserError", 2);
}
/******************************************************************************
* *
* Purpose: initialize browser and webdriver error objects *
* *
******************************************************************************/
int es_browser_init_errors(zbx_es_t *es, char **error)
{
if (0 != setjmp(es->env->loc))