Skip to content

Commit

Permalink
[backend] fix error handling when requesting not existing notificatio…
Browse files Browse the repository at this point in the history
…n payload
  • Loading branch information
adrianschroeter committed Jul 15, 2014
1 parent b9e131a commit 938b8e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/bs_srcserver
Expand Up @@ -241,7 +241,9 @@ sub lastnotifications {

sub getnotificationpayload {
my ($cgi, $payloadkey) = @_;
return (readstr("$notificationpayloaddir/$payloadkey"), 'Content-Type: application/json');
my $file = "$notificationpayloaddir/$payloadkey";
die("404 payload does not exist!\n") unless -e $file;
return (readstr($file), 'Content-Type: application/json');
}

sub deletenotificationpayload {
Expand Down

0 comments on commit 938b8e4

Please sign in to comment.