Skip to content

Commit

Permalink
[#737] Added comments about commented out error handling code in MT::…
Browse files Browse the repository at this point in the history
…ObjectDriver::Driver::DBD::SQLite which yields unhelpful errors in the face of database file permissions problems.
  • Loading branch information
jayallen committed Feb 3, 2011
1 parent 68d8cba commit aba5a2c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/MT/ObjectDriver/Driver/DBD/SQLite.pm
Expand Up @@ -75,21 +75,31 @@ sub dsn_from_config {
my $old = umask($umask);
local *JUNK;
sysopen JUNK, $db_file, O_RDWR | O_CREAT, 0666 or return undef;

# FIXME Commented out error leads to unhelpful DBI error
# I believe the last change here (commenting out error and
# returning undef) is masking a useful initialization error in favor
# of DBI's not so useful one
#or return $driver->error(MT->translate("Can't open '[_1]': [_2]", $db_file, $!));
close JUNK;
umask($old);
}
unless ( -w $db_file ) {
return undef;

# FIXME Commented out error leads to unhelpful DBI error
# I believe the last change here (commenting out error and
# returning undef) is masking a useful initialization error in favor
# of DBI's not so useful one
#return $driver->error(MT->translate(
# "Your database file ('[_1]') is not writable.", $db_file));
}
my $dir = dirname($db_file);
unless ( -w $dir ) {
return undef;

# FIXME Commented out error leads to unhelpful DBI error
# I believe the last change here (commenting out error and
# returning undef) is masking a useful initialization error in favor
# of DBI's not so useful one
#return $driver->error(MT->translate(
# "Your database directory ('[_1]') is not writable.", $dir));
}
Expand Down

0 comments on commit aba5a2c

Please sign in to comment.