httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Vanasco <apreq-dev-l...@2xlp.com>
Subject feature request - error code ( not string ) in perl glue
Date Wed, 25 Apr 2007 23:38:41 GMT
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 )




Mime
View raw message