[Jifty-commit] jifty branch, setupwizard-refactor, updated. 01ada000ff224b77eb6c829048de1aa995275771

Jifty commits jifty-commit at lists.jifty.org
Wed Jul 7 16:04:29 EDT 2010


The branch, setupwizard-refactor has been updated
       via  01ada000ff224b77eb6c829048de1aa995275771 (commit)
      from  39cbe3f733621f48f7c509876b351505db59e2a4 (commit)

Summary of changes:
 lib/Jifty/Schema.pm        |    4 +++-
 lib/Jifty/Script/Schema.pm |   11 ++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 01ada000ff224b77eb6c829048de1aa995275771
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jul 7 16:05:51 2010 -0400

    A little more error handling

diff --git a/lib/Jifty/Schema.pm b/lib/Jifty/Schema.pm
index c6238b6..18da178 100644
--- a/lib/Jifty/Schema.pm
+++ b/lib/Jifty/Schema.pm
@@ -276,7 +276,9 @@ sub create_all_tables {
     }
 
     # Commit it all
-    Jifty->handle->commit or exit 1;
+    Jifty->handle->commit
+        or die "Error committing create_all_tables: "
+               . Jifty->handle->errstr . "\n";
 
     Jifty::Util->require('IPC::PubSub');
     IPC::PubSub->new(
diff --git a/lib/Jifty/Script/Schema.pm b/lib/Jifty/Script/Schema.pm
index fe4fbb5..15ad4a5 100644
--- a/lib/Jifty/Script/Schema.pm
+++ b/lib/Jifty/Script/Schema.pm
@@ -149,7 +149,16 @@ sub run {
 
     $self->print_help();
     $self->setup_environment();
-    $self->schema->setup_database();
+
+    eval {
+        $self->schema->setup_database();
+    };
+
+    if ( $@ =~ /Error comitting create_all_tables/ ) {
+        exit 1; # Replicate the exit functionality we replaced with die
+    } elsif ( $@ ) {
+        die $@; # Throw it again
+    }
 
     print "Done.\n";
 }

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list