Skip to content

Commit

Permalink
Merge pull request #833 from Worteks/issue-809-bad-error-signal
Browse files Browse the repository at this point in the history
Error handling when using the signal-cli api for sms
  • Loading branch information
coudot authored Feb 6, 2024
2 parents 5841af9 + a1bc049 commit cc99125
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/smsapi-signal-cli.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ function send_sms_by_api($mobile, $message) {

$v = '';
$o = '';
exec($command, $o, $v);
exec($command." 2>&1", $o, $v);

if ($v !== 0) {
error_log('Error sending message: ' . $o);
return 0;
error_log('Error sending message: ');
$o_size = count($o);
for ($x = 0; $x < $o_size; $x++) {
error_log(' ' . $o[$x]);
}

return 0;

}
return 1;
}
Expand Down

0 comments on commit cc99125

Please sign in to comment.