fix: dont log user errors (#4660)

This commit is contained in:
Dag 2025-08-08 02:16:43 +02:00 committed by GitHub
parent 81ce9c9483
commit a599f4ba83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 7 deletions

View file

@ -242,9 +242,16 @@ function create_random_string(int $bytes = 16): string
return bin2hex(openssl_random_pseudo_bytes($bytes));
}
/**
* Thrown by bridges to indicate user failure. Will not be logged.
*/
final class ClientException extends \Exception
{
}
function throwClientException(string $message = '')
{
throw new \Exception($message, 400);
throw new ClientException($message, 400);
}
function throwServerException(string $message = '')