version 22.8.4.7

How to reproduce:

1. Add section to config.xml
`    <query_masking_rules>
        <rule>
            <name>hide encrypt/decrypt arguments</name>
            <regexp>((?:aes_)?(?:encrypt|decrypt)(?:_mysql)?)\s*\(\s*(?:'(?:\\'|.)+'|.*?)\s*\)</regexp>
            <!-- or more secure, but also more invasive:
                (aes_\w+)\s*\(.*\)
            -->
            <replace>\1(???)</replace>
        </rule>
    </query_masking_rules>
`
2. Run query and get exception
`select decrypt('aes-256-ecb', 'my_text', 'mykey123451234512345123451234512');` 

3. Check query_log
`select exception, query from system.query_log
where exception_code>0
order by event_time desc
limit 1`

Here we have masked query 
`select decrypt(???)`
And not masked exception message
`Code: 454. DB::Exception: Failed to decrypt. OpenSSL error code: 503316603: While processing decrypt('aes-256-ecb', 'my_text', 'mykey123451234512345123451234512'). (OPENSSL_ERROR) (version 22.8.4.7 (official build))`
And for example, i can easily get encrypt key from the exception message
std::optional<std::string> getPath() const { return path; }
private:
    int saved_errno;
    std::optional<std::string> path;
    const char * name() const noexcept override { return "DB::ErrnoException"; }
    const char * className() const noexcept override { return "DB::ErrnoException"; }
};
class ParsingException : public Exception
{
public:
    ParsingException();
    ParsingException(const std::string & msg, int code);
    ParsingException(int code, const std::string & message);
    
    template <typename... Args>
    ParsingException(int code, fmt::format_string<Args...> fmt, Args &&... args) : Exception(code, fmt, std::forward<Args>(args)...)
    {
    }
    std::string displayText() const override;
    ssize_t getLineNumber() const { return line_number; }
    void setLineNumber(int line_number_) { line_number = line_number_;}
    String getFileName() const { return file_name; }
    void setFileName(const String & file_name_) { file_name = file_name_; }
    Exception * clone() const override { return new ParsingException(*this); }
    void rethrow() const override { throw *this; }
private:
    ssize_t line_number{-1};
    String file_name;
    mutable std::string formatted_message;
    const char * name() const noexcept override { return "DB::ParsingException"; }