summaryrefslogtreecommitdiff
path: root/lib/JWebmail/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'lib/JWebmail/Controller')
-rw-r--r--lib/JWebmail/Controller/Webmail.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/JWebmail/Controller/Webmail.pm b/lib/JWebmail/Controller/Webmail.pm
index c61c493..ce18de8 100644
--- a/lib/JWebmail/Controller/Webmail.pm
+++ b/lib/JWebmail/Controller/Webmail.pm
@@ -194,13 +194,14 @@ sub readmail {
my $auth = $self->stash(ST_AUTH);
my $mail;
- eval { $mail = $self->users->show($auth, $mid) };
- if (my $err = $@) {
+ my $ok = eval { $mail = $self->users->show($auth, $mid); 1 };
+ if (!$ok) {
+ my $err = $@;
if ($err =~ m/unkown mail-id|no such message/) {
$self->reply->not_found;
return;
}
- die $@;
+ die;
}
# select a single body element