Better error logging

merge-requests/5/head
Terence Eden 2024-06-26 09:39:00 +01:00
rodzic 0f755b4d97
commit dc533a57d0
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -1063,7 +1063,8 @@ HTML;
// Check for errors
if( curl_errno( $ch ) ) {
$timestamp = ( new DateTime() )->format( DATE_RFC3339_EXTENDED );
file_put_contents( $directories["logs"] . "/{$timestamp}.Error.txt", curl_error( $ch ) );
$error_message = curl_error( $ch ) . "\ninbox: {$inbox}\nmessage: " . json_encode($message);
file_put_contents( $directories["logs"] . "/{$timestamp}.Error.txt", $error_message );
return false;
}
curl_close( $ch );