You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Jonathan Vanasco <ap...@2xlp.com> on 2007/04/26 01:38:41 UTC

feature request - error code ( not string ) in perl glue

Currently , on error, the following return string error messages:

	$req->args_status()
	$req->body_status()
	$req->param_status()

i'd like to suggest the following change:

a:
	new module Apache2::Request::Constants

		operates in the same manner as Apache2::Const

b:
	an optional parameter returns a tuple/list of ( $string_error ,  
$const_code )
	without the parameter, the current functionality remains , so its  
fully backwards compatible.

		$req->args_status(1)
		$req->body_status(1)
		$req->param_status(1)

		or

		$req->args_status(list=>1)
		$req->body_status(list=>1)
		$req->param_status(list=>1)

why?
	matching string errors is really ugly

	to replace this:
		my  $error= $apr->body_status();
		if ( $error eq 'Exceeds configured maximum limit' )

	with something like this:
		my  ($code,$error)= $apr->body_status(1);
		if ( $code == APR::Const::EXCEEDED_MAXIMUM )




Re: feature request - error code ( not string ) in perl glue

Posted by Jonathan Vanasco <jv...@2xlp.com>.
On Apr 25, 2007, at 8:01 PM, Joe Schaefer wrote:

>> The returned error scalars are dual-variables, so you can
>> compare them numerically or as strings.  We probably just
>> need to export more of the actual error codes via  
>> APR::Request::Error.
>
> Actually there are quite a few of them in
>
> https://svn.apache.org/repos/asf/httpd/apreq/trunk/glue/perl/ 
> xsbuilder/APR/Request/Error/Error.xs
>
> we probably just need to document them.

AWESOME!!!

this is so much more natural feeling.

thanks a ton!

Re: feature request - error code ( not string ) in perl glue

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Schaefer <jo...@sunstarsys.com> writes:

> Jonathan Vanasco <ap...@2xlp.com> writes:
>
>> Currently , on error, the following return string error messages:
>>
>> 	$req->args_status()
>> 	$req->body_status()
>> 	$req->param_status()
>
> The returned error scalars are dual-variables, so you can
> compare them numerically or as strings.  We probably just
> need to export more of the actual error codes via APR::Request::Error.

Actually there are quite a few of them in

https://svn.apache.org/repos/asf/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Error/Error.xs

we probably just need to document them.
-- 
Joe Schaefer


Re: feature request - error code ( not string ) in perl glue

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Jonathan Vanasco <ap...@2xlp.com> writes:

> Currently , on error, the following return string error messages:
>
> 	$req->args_status()
> 	$req->body_status()
> 	$req->param_status()

The returned error scalars are dual-variables, so you can
compare them numerically or as strings.  We probably just
need to export more of the actual error codes via APR::Request::Error.

-- 
Joe Schaefer