Re: http server
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Hard to say. It just signals failure of the HTTP handler. Typically, the
way to debug is
?- tspy(doit/1).
Now, do the query. That should bring up the debugger. Now step through it
to see why it fails.
Cheers --- Jan
On 11/15/2013 11:41 PM, Josef Frydl wrote:
> I am getting following error
> when I try to open working file within serving get request : open('/Users/joseffrydl/Desktop/proKatu/workingOn/res.txt', write, YY), files is not opened, even though this code just before that works
> form_query(Search),atom_codes(A, Search),
> open('/Users/joseffrydl/Desktop/proKatu/workingOn/res.html', write, S),
> http_open(A, In, [status_code(Code)]),copy_stream_data(In, S),close(In),close(S), it works up to here,
> but open
> : open('/Users/joseffrydl/Desktop/proKatu/workingOn/res.txt', write, YY), does not work throwing exception below
>
> Internal server error
>
> goal unexpectedly failed: user:doit([session(394f-64ce-9e1f-b18d.macintosh),pool(client(httpd@8000,user:http_dispatch,<stream>(0x686370),<stream>(0x6865b0))),peer(ip(127,0,0,1)),protocol(http),input(<stream>(0x686370)),method(get),request_uri(/doit?dit=Do+it),path(/doit),search([dit=Do it]),http_version(1-1),host(localhost),port(8000),connection(keep-alive),accept([media(text/html,[],1.0,[]),media(application/xhtml+xml,[],1.0,[]),media(image/webp,[],1.0,[]),media(application/xml,[],0.9,[]),media(_G446/_G447,[],0.8,[])]),user_agent(Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1707.0 Safari/537.36),referer(http://localhost:8000/gather?fname=Wa&keyword=War%2CDrugs&proximity=sentence&submit=Submit),accept_encoding(gzip,deflate,sdch),accept
_language(en-US,en;q=0.8),cookie([swipl_session=394f-64ce-9e1f-b18d.macintosh])])
> In:
> [19] throw(error(...,_G503))
> [18] http_dispatch:call_action(user:doit,[...|...]) at /opt/local/lib/swipl-6.5.2/library/http/http_dispatch.pl:597
> [16] time:run_alarm_goal('$alarm'(5506952),http_dispatch: ...) at /opt/local/lib/swipl-6.5.2/library/time.pl:123
> [15] setup_call_catcher_cleanup(time: ...,time: ...,_G560,time: ...) at /opt/local/lib/swipl-6.5.2/boot/init.pl:310
> [8] httpd_wrapper:call_handler(user:http_dispatch,5,[...|...]) at /opt/local/lib/swipl-6.5.2/library/http/http_wrapper.pl:257
> [7] catch(httpd_wrapper: ...,error(...,...),httpd_wrapper:true) at /opt/local/lib/swipl-6.5.2/boot/init.pl:274
> [6] httpd_wrapper:handler_with_output_to(user:http_dispatch,5,[...|...],current_output,error(...,...)) at /opt/local/lib/swipl-6.5.2/library/http/http_wrapper.pl:237
> [5] httpd_wrapper:handler_with_output_to(user:http_dispatch,5,[...|...],<stream>(0x1801d40),error(...,...)) at /opt/local/lib/swipl-6.5.2/library/http/http_wrapper.pl:247
> [4] httpd_wrapper:http_wrapper(user:http_dispatch,<stream>(0x686370),<stream>(0x6865b0),_G690,[...|...]) at /opt/local/lib/swipl-6.5.2/library/http/http_wrapper.pl:89
> [3] thread_httpd:http_process(user:http_dispatch,<stream>(0x686370),<stream>(0x6865b0),[...|...]) at /opt/local/lib/swipl-6.5.2/library/http/thread_httpd.pl:549
> [2] catch(thread_httpd: ...,_G734,thread_httpd:true) at /opt/local/lib/swipl-6.5.2/boot/init.pl:274
> [1] thread_httpd:http_worker([...|...]) at /opt/local/lib/swipl-6.5.2/library/http/thread_httpd.pl:382
> [0] <meta call>
>
> thanks Josef Frydl
>
>
> -------------- next part --------------
> HTML attachment scrubbed and removed
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>