Skip to content

Commit

Permalink
Send Exception to Discord (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akkarinage authored Jun 1, 2024
1 parent d6d9b73 commit 09b45fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
'DiscordSendOnNewTicket' => true, // Sends a channel message when someone submits a new ticket to the Service Desk
'DiscordSendOnWebCommand' => true, // Sends a channel message when someone uses the Web Command feature in FluxCP
'DiscordSendOnMarketing' => true, // Sends a channel message when someone uses the Send Email feature in FluxCP
'DiscordSendOnErrorException' => true, // Sends a channel message when an exception is thrown

'TinyMCEKey' => 'no-key', // Register for a key at https://www.tiny.cloud/my-account/dashboard/

Expand Down
10 changes: 10 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@
}
}

if(Flux::config('DiscordUseWebhook')) {
if(Flux::config('DiscordSendOnErrorException')) {
sendtodiscord(Flux::config('DiscordWebhookURL'), '```ansi
ERROR
Error: '. get_class($e) .'
Exception: '. $e->getMessage() .'
File: '. $e->getFile() .':'. $e->getLine() .'```');
}
}

require_once FLUX_CONFIG_DIR.'/error.php';
define('__ERROR__', 1);
include $errorFile;
Expand Down

0 comments on commit 09b45fa

Please sign in to comment.