what is the cause of this error?

29 views
Skip to first unread message

夜帝

unread,
Feb 11, 2012, 10:33:44 PM2/11/12
to chica...@googlegroups.com
I see in cb_admin,there are two same functions in a controller,as follows:
delete('GET', [App, Lang], Auth) ->
    {ok, [{lang_section, true}, {this_application, App}, {applications, boss_web:get_all_applications()},
            {this_lang, Lang}]};
delete('POST', [App, Lang], Auth) ->
    AppAtom = list_to_atom(App),
    boss_lang:delete_lang(AppAtom, Lang),
    boss_web:reload_translation(Lang),
    {redirect, [{action, "show"}]}.
But in my project,I create two functions like this in my controller:
delete('GET', [])->
……
ok.
delete('POST', [])->
……
……
ok.

[root@Libra busmeet]# ./rebar compile
==> busmeet (pre_compile)
ERROR: pre_compile failed while processing /root/Erlang/busmeet: {'EXIT',{{badmatch,{error,[{"/root/Erlang/busmeet/src/controller/busmeet_main_controller.erl",
                            [{{17,1},
                              erl_lint,
                              {redefine_function,{delete,2}}}]}]}},
         [{boss_load,load_all_modules,3},
          {boss_load,load_all_modules_and_emit_app_file,2},
          {boss_rebar,compile,4},
          {boss_plugin,pre_compile,2},
          {rebar_core,run_modules,4},
          {rebar_core,execute,4},
          {rebar_core,process_dir0,6},
          {rebar_core,process_commands,2}]}}

Chan

unread,
Feb 12, 2012, 5:59:05 AM2/12/12
to chica...@googlegroups.com
Hi
You should put ; instead of dot for the first fun

delete('GET',[]) -> bla,bla;
delete('POST',[]) -> bla, bla.

Envoyé de mon iPhone

夜帝

unread,
Feb 12, 2012, 7:47:48 AM2/12/12
to chica...@googlegroups.com
thanks  Chan !

2012/2/12 Chan <chan.s...@gmail.com>



--
我踏月色而来!
Reply all
Reply to author
Forward
0 new messages