Mercurial > eagle-eye
comparison Ikariam.pm @ 265:aaffc50e3318
try to handle db_error
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Tue, 25 Nov 2008 20:15:26 +0800 |
parents | 83e3ce37779d |
children | 285d5b39ef2c |
comparison
equal
deleted
inserted
replaced
264:3b3f1306255a | 265:aaffc50e3318 |
---|---|
1 | |
1 BEGIN { | 2 BEGIN { |
2 foreach (((getpwuid($<))[7], $ENV{HOME}, $ENV{LOGDIR}, ".")) { | 3 foreach (((getpwuid($<))[7], $ENV{HOME}, $ENV{LOGDIR}, ".")) { |
3 require "$_/.eagleeye.pm" if (-f "$_/.eagleeye.pm"); | 4 require "$_/.eagleeye.pm" if (-f "$_/.eagleeye.pm"); |
4 } | 5 } |
5 } | 6 } |
7 | |
8 package Ikariam::Base; | |
9 use strict; | |
10 require Class::DBI::SQLite; | |
11 use base qw(Class::DBI::SQLite); | |
12 | |
13 sub _db_error { | |
14 my ($self, %info) = @_; | |
15 my $msg = delete $info{msg}; | |
16 die($msg); | |
17 # return $self->_carp($msg, %info); | |
18 } | |
19 | |
20 1; | |
6 | 21 |
7 use Class::DBI::AutoLoader ( | 22 use Class::DBI::AutoLoader ( |
8 dsn => 'dbi:SQLite:dbname=ikariam.sqlite', | 23 dsn => 'dbi:SQLite:dbname=ikariam.sqlite', |
9 options => { RaiseError => 1 }, | 24 options => { RaiseError => 1 }, |
10 tables => ['cities', 'island', 'user', 'ally', 'report'], | 25 tables => ['cities', 'island', 'user', 'ally', 'report'], |
11 use_base => 'Class::DBI::SQLite', | 26 use_base => 'Ikariam::Base', |
12 namespace => 'Ikariam', | 27 namespace => 'Ikariam', |
13 ); | 28 ); |
14 | 29 |
15 package Ikariam::Extractor; | 30 package Ikariam::Extractor; |
16 use strict; | 31 use strict; |