intellij-idea 如何破译Erlang运行时错误消息

vohkndzv  于 2022-11-01  发布在  Erlang
关注(0)|答案(1)|浏览(262)

当我使用IntelliJ的“运行配置”运行Erlang函数时,我收到以下错误消息。错误消息包含许多嵌套的括号。请帮助我理解该消息。

  1. "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
  2. 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,[{_},{_}]}]})
  3. 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}]}]}}
  4. done

右键单击.erl文件中的函数,然后单击“运行”。

3mpgtkmj

3mpgtkmj1#

错误消息由错误代码和堆栈跟踪组成。
1.错误代码为badarg。请参阅Exit Reasons以获取错误代码列表。
1.堆栈跟踪为每个函数调用包含一个条目。每个调用都提供文件名、函数名和行号。例如,{init,start_em,1,[{file,"init.erl"},{line,1220}]}表示init.erl是文件,start_em是函数,1220是行号。
在手动缩进之后,我们可以更好地可视化堆栈跟踪,如下所示。

  1. {badarg,[
  2. {ets,select,[ct_attributes,[_]],[{_}]},
  3. {ct_config,get_key_from_name,1,[{_},{_}]},
  4. {ct_util,does_connection_exist,3,[{_},{_}]},
  5. {ct_gen_conn,do_start,4,[{_},{_}]},
  6. {ct_netconfc,open,4,[{_},{_}]},
  7. {erl_eval,do_apply,7,[{_},{_}]},
  8. {init,start_it,1,[{_},{_}]},
  9. {init,start_em,1,[{_},{_}]}
  10. ]}
  11. {badarg,[
  12. {ets,select,[ct_attributes,[{{ct_conf,'$1','_','_','_',undefined,'_'},[],['$1']}]],[{error_info,#{cause=>id,module=>erl_stdlib_errors}}]},
  13. {ct_config,get_key_from_name,1,[{file,"ct_config.erl"},{line,578}]},
  14. {ct_util,does_connection_exist,3,[{file,"ct_util.erl"},{line,577}]},
  15. {ct_gen_conn,do_start,4,[{file,"ct_gen_conn.erl"},{line,281}]},
  16. {ct_netconfc,open,4,[{file,"ct_netconfc.erl"},{line,424}]},
  17. {erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]},
  18. {init,start_it,1,[{file,"init.erl"},{line,1234}]},
  19. {init,start_em,1,[{file,"init.erl"},{line,1220}]}
  20. ]}
展开查看全部

相关问题