App-Office-Contacts
view release on metacpan or search on metacpan
lib/App/Office/Contacts/Controller/Initialize.pm view on Meta::CPAN
package App::Office::Contacts::Controller::Initialize;
use parent 'App::Office::Contacts::Controller';
use strict;
use utf8;
use warnings;
use warnings qw(FATAL utf8); # Fatalize encoding glitches.
use Try::Tiny;
# We don't use Moo because we isa CGI::Snapp.
our $VERSION = '2.04';
# -----------------------------------------------
sub display
{
my($self) = @_;
$self -> log(debug => 'Controller::Initialize.display()');
$self -> param('db') -> simple -> begin_work;
my($response);
try
{
$response = $self -> build_web_page;
$self -> param('db') -> simple -> commit;
}
catch
{
my($error) = $_;
$self -> param('db') -> simple -> rollback;
# Try to log the error despite the error.
$self -> log(error => "System error: $error");
$response = $self -> param('system_error');
};
return $response;
} # End of display.
# -----------------------------------------------
1;
=head1 NAME
App::Office::Contacts::Controller::Initialize - A web-based contacts manager
=head1 Synopsis
See L<App::Office::Contacts/Synopsis>.
=head1 Description
L<App::Office::Contacts> implements a utf8-aware, web-based, private and group contacts manager.
=head1 Distributions
See L<App::Office::Contacts/Distributions>.
=head1 Installation
( run in 0.830 second using v1.01-cache-2.11-cpan-39bf76dae61 )