Miklos Tirpak wrote:
> Hi all,
>
> there is an issue with error handling as well, the result of an
> expression evaluation that causes error can be hardly determined, for
> example:
>
> @rr.uri tries to parse the RR HF, and get the URI part of it, but it
> returns an error if the RR HF is missing from the request, because the
> parsing fails:
>
> if (@rr.uri) is false, which is correct.
>
> if ([EMAIL PROTECTED]) is also false, which is strange. The error is
> captured,
> and eval_expr() exists before negating the result.
>
> if (@rr.uri || 1) is also false, because nothing after @rr.uri is checked.
>
> The problem exists with AVPs as well:
>
> $second = 2;
> if ($second != "foo") is false, which means 2=="foo". The reason is the
> same as above, the string cannot be converted to integer, thus, the
> evaluator returns error.
>
> None of the above expressions should result error in my opinion, they
> could simply return true or false instead. What do you think?
Yes, I agree, I was my impression that is already worked that way, but
probably not.
Jan.
_______________________________________________
Serdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/serdev