Para::Frame::Result - Holds the results of actions and exceptions
The result object holds the results of the actions taken and exceptions thrown (Para::Frame::Utils/throw).
$result->{info} is the storage space for actions results. Put your data in an apropriate subhash. Example:
$result->{info}{myresult} = \@listresult;
The info hash is accessed in the template as result.info
.
1. throw() takes a PF_part or TT_exception or custom gives TT_exception
1. die() takes any obj or text gives the same
1. Template exceptions gives a TT_exception
2. catch() takes any obj or text gives a TT_exception or PF_part or undef
3. $result->exception() (runs on_error code) takes the same as throw() gives a PF_part uses $result->error() uses Para::Frame::Result::Part->new()
$result->exception() $result->exception($error) $result->exception($type, $info, $text)
If called with no params, uses $@ as $error.
If called with more than one params, creates an $error object with type $type, info $info and text $text. $text can be undef.
returns the generated Para::Frame::Result::Part.
If $error is a Part, just returns it.
For other errors, adds parts to result and returns one of them.
$result->error( $type, $message, $contextref ) $result->error( $type, $message ) $result->error( $exception_obj )
Creates a new Para::Frame::Result::Part and adds it to the result. Clears out $@
Marks the part as hidden if it is of a type that should be hidden or if hide_all is set.
The part type determines if the result is flagd for backtracking; making the resulting page uri and template the same as the origin page.
Returns the part.
Returns the number of errors in the result.
$result->backtrack() $result->backtrack(0) $result->backtrack(1)
If given a defined param, sets the switch to that value.
Must be a number. The value will change by future errors.
Returns:
true if we should backtrack because of the result.
Returns a reference to a list of all Para::Frame::Result::Part objects.
Returns all visible error parts.
Returns all visible info parts.
$result->find( $type )
$type is the name of the type in string format.
Retruns the first part in the result that is of the specified type.
$result->hide_part( $type ) $result->hide_part()
Hides all errors of the specified type.
Of no type is given; hides all errors.
Nothing returned.
Returns the result in string format.
$res->import( $res2 )
Import the result from another request into this result.