jj1bdx / erltrek

An Erlang Star Trek game
http://jj1bdx.github.io/erltrek
Other
16 stars 2 forks source link

erltrek_terminal.erl crashes for an irregular input in the impulse command #8

Closed jj1bdx closed 10 years ago

jj1bdx commented 10 years ago

Parsing problem?

Command > impulse 1,2,3,4

=ERROR REPORT==== 15-Mar-2014::08:47:46 ===
Error in process <0.35.0> with exit value: {badarg,[{erlang,list_to_integer,["1,2,3,4"],[]},{erltrek_terminal,parse_arg,1,[{file,"src/erltrek_terminal.erl"},{line,224}]},{erltrek_terminal,'-parse_args/1-lc$^0/1-0-',1,[{file,"src/erltrek_terminal.erl"},{line,220}]},{erltrek_terminal...

=ERROR REPORT==== 15-Mar-2014::08:47:46 ===
** gen_event handler erltrek_terminal crashed.
** Was installed in erltrek_event
** Last event was: {'EXIT',<0.35.0>,
                       {badarg,
                           [{erlang,list_to_integer,["1,2,3,4"],[]},
                            {erltrek_terminal,parse_arg,1,
                                [{file,"src/erltrek_terminal.erl"},
                                 {line,224}]},
                            {erltrek_terminal,'-parse_args/1-lc$^0/1-0-',1,
                                [{file,"src/erltrek_terminal.erl"},
                                 {line,220}]},
                            {erltrek_terminal,dispatch_command,1,
                                [{file,"src/erltrek_terminal.erl"},
                                 {line,207}]},
                            {erltrek_terminal,captains_loop,0,
                                [{file,"src/erltrek_terminal.erl"},
                                 {line,188}]}]}}
** When handler state == []
** Reason == {'function not exported',
                 [{erltrek_terminal,handle_info,
                      [{'EXIT',<0.35.0>,
                           {badarg,
                               [{erlang,list_to_integer,["1,2,3,4"],[]},
                                {erltrek_terminal,parse_arg,1,
                                    [{file,"src/erltrek_terminal.erl"},
                                     {line,224}]},
                                {erltrek_terminal,'-parse_args/1-lc$^0/1-0-',
                                    1,
                                    [{file,"src/erltrek_terminal.erl"},
                                     {line,220}]},
                                {erltrek_terminal,dispatch_command,1,
                                    [{file,"src/erltrek_terminal.erl"},
                                     {line,207}]},
                                {erltrek_terminal,captains_loop,0,
                                    [{file,"src/erltrek_terminal.erl"},
                                     {line,188}]}]}},
                       []],
                      []},
                  {gen_event,server_update,4,
                      [{file,"gen_event.erl"},{line,522}]},
                  {gen_event,server_notify,4,
                      [{file,"gen_event.erl"},{line,504}]},
                  {gen_event,handle_exit,4,
                      [{file,"gen_event.erl"},{line,343}]},
                  {gen_event,handle_msg,5,[{file,"gen_event.erl"},{line,273}]},
                  {proc_lib,init_p_do_apply,3,
                      [{file,"proc_lib.erl"},{line,239}]}]}
kaos commented 10 years ago

Yes.. (try that with spaces instead of commas "impulse 1 2 3 4").

kaos commented 10 years ago

Hmm.. gitbug don't want to show my cross ref here..

jj1bdx commented 10 years ago

Fix merged at #9. Closed. PS: I've tried the space separation and the impulse command worked. I wanted to know what caused the error.