Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  view function undefined?

Guest
Posted: Wed May 07, 2008 4:07 pm Reply with quote
Guest
Hi list

I have an error that I don't quite get. I have the following files:

game_controller.erl
game_view.erl

I receive the request in acceptmsg(A) inside game_controller.erl and
after doing my processing, I make this call as the return from the
function so the function looks like this:

acceptmsg(A, Some, Parameter) ->
%% some processing which sets Result
{data, Result}.

Then I have a function defined in game_view.erl like this:

acceptmsg(A) ->
[A].

However when I call the function and try to return the result to the
browser, I get this error:

ERROR erlang code crashed:
File: appmod:0
Reason: {undef,[{game_view,acceptmsg,
["Result"]},
{erlyweb,'-handle_response/5-fun-0-',5},
{lists,map,2},
{erlyweb,handle_response,5},
{erlyweb,ewc,2},
{erlyweb,handle_request,6},
{yaws_server,deliver_dyn_part,8},
{yaws_server,aloop,3}]}
Req: {http_request,'GET',
{abs_path,"/erltsb/game/acceptmsg/some/
parameters"},
{1,1}}

Anyone seen something like this or know what the problem is? I am
exporting all the relevant functions in the files.

Nii Amon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post received from mailinglist
Guest
Posted: Mon May 12, 2008 11:12 am Reply with quote
Guest
I couldn't find out what the problem was but you can basically use a
response tuple to achieve the same result like this:

{response, [{html, ResponseText}] }

On May 7, 4:06
Guest
Posted: Wed May 14, 2008 5:56 am Reply with quote
Guest
I'm pretty sure that for some reason the game_view module wasn't
compiled properly. Try calling the acceptmsg function from the Yaws
shell and see if it works...

On Mon, May 12, 2008 at 4:11 AM, nii amon <jazzyy@gmail.com> wrote:
>
> I couldn't find out what the problem was but you can basically use a
> response tuple to achieve the same result like this:
>
> {response, [{html, ResponseText}] }
>
> On May 7, 4:06 pm, nii amon <jaz...@gmail.com> wrote:
>> Hi list
>>
>> I have an error that I don't quite get. I have the following files:
>>
>> game_controller.erl
>> game_view.erl
>>
>> I receive the request in acceptmsg(A) inside game_controller.erl and
>> after doing my processing, I make this call as the return from the
>> function so the function looks like this:
>>
>> acceptmsg(A, Some, Parameter) ->
>> %% some processing which sets Result
>> {data, Result}.
>>
>> Then I have a function defined in game_view.erl like this:
>>
>> acceptmsg(A) ->
>> [A].
>>
>> However when I call the function and try to return the result to the
>> browser, I get this error:
>>
>> ERROR erlang code crashed:
>> File: appmod:0
>> Reason: {undef,[{game_view,acceptmsg,
>> ["Result"]},
>> {erlyweb,'-handle_response/5-fun-0-',5},
>> {lists,map,2},
>> {erlyweb,handle_response,5},
>> {erlyweb,ewc,2},
>> {erlyweb,handle_request,6},
>> {yaws_server,deliver_dyn_part,8},
>> {yaws_server,aloop,3}]}
>> Req: {http_request,'GET',
>> {abs_path,"/erltsb/game/acceptmsg/some/
>> parameters"},
>> {1,1}}
>>
>> Anyone seen something like this or know what the problem is? I am
>> exporting all the relevant functions in the files.
>>
>> Nii Amon
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum