Ticket #408 (closed Bug: fixed)

Opened 3 months ago

Last modified 3 months ago

Forge_Core error handling of classes

Reported by: xadio Assigned to: Shadowhand
Priority: minor Milestone: 2.2
Component: Modules:Forge Version: SVN HEAD
Keywords: Forge invalid method unknown input Cc:
SVN Revision (if applicable):

Description

When a non existent method is requested from Forge (ie Forge::render in 2.1.1 release) it returns the following error:

Framework Error

Please check the Kohana documentation for information about the following error.

Invalid input type requested:

Error occurred at line 101 of /www/kohana/v2.1.1/modules/forge/libraries/Forge.php.

However, note the "Invalid input type requested:". It is misleading on two points. First it implies that the input type wasn't requested and secondly it implies that one specified an input type.

Code:

if ( ! ($input instanceof Form_Input) AND ! ($input instanceof Forge))
			throw new Kohana_Exception('forge.invalid_input', get_class($input));

Here is a possible fix, if necessary... Code:

$class = get_class($input);
		if ( ! ($input instanceof Form_Input) AND ! ($input instanceof Forge))
			if ( ! empty($class))
				throw new Kohana_Exception('forge.invalid_input', $class);
			else
				throw new Kohana_Exception('forge.invalid_method', $method);

Change History

02/16/08 18:16:27 changed by xadio

forge.invalid_method is a nonexistent exception. I am not sure how the exceptions are created, so my apologies.

02/21/08 20:53:56 changed by Shadowhand

  • keywords changed from Forge, Forge_Core, error handling to Forge invalid method unknown input.
  • status changed from new to assigned.
  • version changed from 2.1 Release to SVN HEAD.
  • milestone set to 2.2.

Fixed in r2123.

02/21/08 20:54:02 changed by Shadowhand

  • status changed from assigned to closed.
  • resolution set to fixed.