[erlang-questions] Yaws user login

Robert Raschke rrerlang@REDACTED
Thu Jun 7 12:51:22 CEST 2007


Patrick wrote:

> Internal error, yaws code crashed
> 
> ERROR erlang  code  crashed:
>  File: /var/www/yaws-default/login.yaws:9
> Reason: {{badmatch,false},
>          [{m26,kv,2},
>           {m26,out,1},
>           {yaws_server,deliver_dyn_part,8},
>           {yaws_server,aloop,3},
>           {yaws_server,acceptor0,2},
>           {proc_lib,init_p,5}]}
> Req: {http_request,'GET',{abs_path,"/login.yaws"},{1,1}}
> 
> 
[... snip ...]
> 
> kv(K,L) ->
>     {value, {K, V}} = lists:keysearch(K,1,L),
>     V.
> 
[... snip ...]


The documentation says:

keysearch(Key, N, TupleList) -> {value, Tuple} | false

	Types:
		Key = term()
		N = 1..size(Tuple)
		TupleList = [Tuple]
		Tuple = tuple()

Searches the list of the tuples TupleList for a tuple whose Nth
element is Key.  Returns {value, Tuple} if such a tuple is found, or
false otherwise.


So, your keysearch returned false.


Robby

--
r(.)raschke(@)tombob(.)com





More information about the erlang-questions mailing list