NAME

Para::Frame::Result - Holds the results of actions and exceptions

DESCRIPTION

The result object holds the results of the actions taken and exceptions thrown (Para::Frame::Utils/throw).

Properties

info

$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.

The process

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()

exception

  $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.

error

  $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.

errcnt

Returns the number of errors in the result.

backtrack

  $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.

parts

Returns a reference to a list of all Para::Frame::Result::Part objects.

error_parts

Returns all visible error parts.

info_parts

Returns all visible info parts.

find

  $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.

hide_part

  $result->hide_part( $type )
  $result->hide_part()

Hides all errors of the specified type.

Of no type is given; hides all errors.

Nothing returned.

as_string

Returns the result in string format.

incorporate

  $res->import( $res2 )

Import the result from another request into this result.

SEE ALSO

Para::Frame