Bug 20912: (QA follow-up) Make unit tests reliable and get rid of perl warnings
[koha.git] / tools / quotes / quotes_ajax.pl
index c4bbae3..79fbe6f 100755 (executable)
@@ -17,8 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-use warnings;
+use Modern::Perl;
 
 use CGI qw ( -utf8 );
 use JSON;
@@ -50,7 +49,7 @@ if ($action eq 'add') {
     $sth->execute($params->{'source'}, $params->{'text'});
     if ($sth->err) {
         warn sprintf('Database returned the following error: %s', $sth->errstr);
-        exit 1;
+        exit 0;
     }
     my $new_quote_id = $dbh->{q{mysql_insertid}}; # ALERT: mysqlism here
     $sth = $dbh->prepare('SELECT * FROM quotes WHERE id = ?;');