diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-25 14:31:33 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-25 14:31:33 +0000 |
commit | f40b706eda465195d9f9585e8fa429a31da870c8 (patch) | |
tree | 028e8c73b6005cd901982b431cbabccee8d2905a /menu.pl | |
parent | 52635d70697fbe0c165c742cd9e9f5e316ff09a5 (diff) |
Display error instead of dying horribly when locale not found
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@303 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'menu.pl')
-rwxr-xr-x | menu.pl | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -87,7 +87,8 @@ use DBI qw(:sql_types); # check for user config file, could be missing or ??? eval { require("$userspath/$form->{login}.conf"); }; if ($@) { - $locale = LedgerSMB::Locale->get_handle($myconfig{countrycode}); + $locale = LedgerSMB::Locale->get_handle($myconfig{countrycode}) or + $form->error("Locale not loaded: $!\n"); $form->{charset} = $locale->encoding; $form->{charset} = 'UTF-8'; $locale->encoding('UTF-8'); @@ -99,7 +100,8 @@ if ($@) { } # locale messages -$locale = LedgerSMB::Locale->get_handle($myconfig{countrycode}); +$locale = LedgerSMB::Locale->get_handle($myconfig{countrycode}) or + $form->error("Locale not loaded: $!\n"); #$form->{charset} = $locale->encoding; $form->{charset} = 'UTF-8'; $locale->encoding('UTF-8'); |