Skip to content

Commit

Permalink
ideone.pl: Improve error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
pasky authored and Petr Baudis committed Sep 15, 2010
1 parent c1697f1 commit 44c59bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions irssi/scripts/ideone.pl
Expand Up @@ -191,20 +191,20 @@ sub ideone {
$code =~ s/\s+$//;

$result = get_result($soap->createSubmission($user, $pass, $code, $languages{$lang}{'id'}, $input, 1, 1));
return $emsg unless defined $result;
return "create: $emsg" unless defined $result;

my $url = $result->{link};

# wait for compilation/execution to complete
while(1) {
$result = get_result($soap->getSubmissionStatus($user, $pass, $url));
return $emsg unless defined $result;
return "submit: $emsg" unless defined $result;
last if $result->{status} == 0;
sleep 1;
}

$result = get_result($soap->getSubmissionDetails($user, $pass, $url, 0, 0, 1, 1, 1));
return $emsg unless defined $result;
return "result: $emsg" unless defined $result;

my $COMPILER_ERROR = 11;
my $RUNTIME_ERROR = 12;
Expand Down Expand Up @@ -291,7 +291,7 @@ sub ideone {
return undef;
} else {
if($result->result->{error} ne "OK") {
$emsg = $result->result->{error};
$emsg = join(", ", map { "$_: " . $result->result->{error}->{$_} } keys %{$result->result->{error}});
return undef;
} else {
return $result->result;
Expand Down

0 comments on commit 44c59bb

Please sign in to comment.