Skip to content

Commit 694a56d

Browse files
committed
fix error messages
1 parent 243bc24 commit 694a56d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

app/Actions/Notifications/SendAppriseTestNotification.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,17 @@ public function handle(array $channel_urls): void
3535
FacadesNotification::route('apprise_urls', $channelUrl)
3636
->notifyNow(new TestNotification);
3737
}
38+
39+
Notification::make()
40+
->title('Test Apprise notification sent successfully')
41+
->success()
42+
->send();
3843
} catch (Throwable $e) {
3944
Notification::make()
4045
->title('Failed to send Apprise test notification')
4146
->body($e->getMessage())
4247
->danger()
4348
->send();
44-
45-
return;
4649
}
47-
48-
Notification::make()
49-
->title('Test Apprise notification sent.')
50-
->success()
51-
->send();
5250
}
5351
}

app/Notifications/AppriseChannel.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@ public function send(object $notifiable, Notification $notification): void
5151
// Execute the apprise command
5252
$result = Process::timeout(30)->run($command);
5353

54+
// Combine stdout and stderr as apprise outputs to both
55+
$fullOutput = trim($result->output()."\n".$result->errorOutput());
56+
5457
if (! $result->successful()) {
55-
throw new Exception('Apprise CLI failed: '.$result->errorOutput());
58+
throw new Exception($fullOutput ?: 'Apprise CLI failed with no output');
5659
}
5760

5861
Log::info('Apprise notification sent', [
5962
'channels' => $urls,
60-
'output' => $result->output(),
63+
'output' => $fullOutput,
6164
]);
6265
} catch (Throwable $e) {
6366
Log::error('Apprise notification failed', [

0 commit comments

Comments
 (0)