From 86f9914d6ddc74968118279bff3bfae7a9733682 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Mon, 5 Mar 2018 17:25:42 +0100
Subject: [PATCH] bless object into class earlier, to handle graceful exit

---
 lib/AccountManager/App.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/AccountManager/App.pm b/lib/AccountManager/App.pm
index fa66bf8..0f52e0d 100644
--- a/lib/AccountManager/App.pm
+++ b/lib/AccountManager/App.pm
@@ -47,6 +47,7 @@ sub new {
     my $self = {
         configuration => $args{configuration},
     };
+    bless $self, $pkg;
 
     if ($self->{configuration}->{logger}) {
         Log::Any::Adapter->set(
@@ -111,8 +112,6 @@ sub new {
 
     $self->{db} = AccountManager::DB->new();
 
-    bless $self, $pkg;
-
     return $self;
 }
 
-- 
GitLab