aboutsummaryrefslogtreecommitdiff
path: root/perl/Wallet/Admin.pm
diff options
context:
space:
mode:
authorJon Robertson <jonrober@stanford.edu>2013-01-30 20:06:37 -0800
committerRuss Allbery <rra@stanford.edu>2013-01-31 15:57:12 -0800
commit22f1c07a21bc6155450de35c838855f73db35d05 (patch)
treebc8c42ad50001dce74b1a2689ec8eefca8f50710 /perl/Wallet/Admin.pm
parent298588849847a5017c696b48193578fe5d69b818 (diff)
Suppress DBIx::Class::Schema::Versioned warnings
DBIx::Class::Schema::Versioned uses carp to send a few warnings that are more just informational messages. Use a local warning handler to skip the warnings we'll always get for normal upgrades. Change-Id: I4f987b290ec17b95d737150dd106e7bb0f62a264 Reviewed-on: https://gerrit.stanford.edu/730 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/Wallet/Admin.pm')
-rw-r--r--perl/Wallet/Admin.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/perl/Wallet/Admin.pm b/perl/Wallet/Admin.pm
index d2e8cb0..c0b1730 100644
--- a/perl/Wallet/Admin.pm
+++ b/perl/Wallet/Admin.pm
@@ -178,6 +178,14 @@ sub upgrade {
$self->{dbh}->install ($BASE_VERSION);
}
+ # Suppress warnings that actually are just informational messages.
+ local $SIG{__WARN__} = sub {
+ my ($warn) = @_;
+ return if $warn =~ m{Upgrade not necessary};
+ return if $warn =~ m{Attempting upgrade};
+ warn $warn;
+ };
+
# Perform the actual upgrade.
if ($self->{dbh}->get_db_version) {
eval { $self->{dbh}->upgrade; };