当我使用IntelliJ的“运行配置”运行Erlang函数时,我收到以下错误消息。错误消息包含许多嵌套的括号。请帮助我理解该消息。
"C:\Program Files\Erlang OTP\bin\erl.exe" -pa F:/1TB/P/workspace-IntelliJ-Erlang2/netconfClient/out/production/netconfClient -pa F:/1TB/P/workspace-IntelliJ-Erlang2/netconfClient -eval netconfManager:open2(). -s init stop -noshell
init terminating in do_boot ({badarg,[{ets,select,[ct_attributes,[_]],[{_}]},{ct_config,get_key_from_name,1,[{_},{_}]},{ct_util,does_connection_exist,3,[{_},{_}]},{ct_gen_conn,do_start,4,[{_},{_}]},{ct_netconfc,open,4,[{_},{_}]},{erl_eval,do_apply,7,[{_},{_}]},{init,start_it,1,[{_},{_}]},{init,start_em,1,[{_},{_}]}]})
Crash dump is being written to: erl_crash.dump...{"init terminating in do_boot",{badarg,[{ets,select,[ct_attributes,[{{ct_conf,'$1','_','_','_',undefined,'_'},[],['$1']}]],[{error_info,#{cause=>id,module=>erl_stdlib_errors}}]},{ct_config,get_key_from_name,1,[{file,"ct_config.erl"},{line,578}]},{ct_util,does_connection_exist,3,[{file,"ct_util.erl"},{line,577}]},{ct_gen_conn,do_start,4,[{file,"ct_gen_conn.erl"},{line,281}]},{ct_netconfc,open,4,[{file,"ct_netconfc.erl"},{line,424}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]},{init,start_it,1,[{file,"init.erl"},{line,1234}]},{init,start_em,1,[{file,"init.erl"},{line,1220}]}]}}
done
右键单击.erl文件中的函数,然后单击“运行”。
1条答案
按热度按时间3mpgtkmj1#
错误消息由错误代码和堆栈跟踪组成。
1.错误代码为
badarg
。请参阅Exit Reasons以获取错误代码列表。1.堆栈跟踪为每个函数调用包含一个条目。每个调用都提供文件名、函数名和行号。例如,
{init,start_em,1,[{file,"init.erl"},{line,1220}]}
表示init.erl是文件,start_em是函数,1220是行号。在手动缩进之后,我们可以更好地可视化堆栈跟踪,如下所示。