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
: Poco::Exception(msg, code)
    , remote(remote_)
{
    handle_error_code(msg, code, remote, getStackFramePointers());
}
Exception::Exception(CreateFromPocoTag, const Poco::Exception & exc)
    : Poco::Exception(exc.displayText(), ErrorCodes::POCO_EXCEPTION)
{
#ifdef STD_EXCEPTION_HAS_STACK_TRACE
    set_stack_trace(exc.get_stack_trace_frames(), exc.get_stack_trace_size());
#endif
}
Exception::Exception(CreateFromSTDTag, const std::exception & exc)
    : Poco::Exception(demangle(typeid(exc).name()) + ": " + String(exc.what()), ErrorCodes::STD_EXCEPTION)
{
#ifdef STD_EXCEPTION_HAS_STACK_TRACE
    set_stack_trace(exc.get_stack_trace_frames(), exc.get_stack_trace_size());
#endif
}
std::string getExceptionStackTraceString(const std::exception & e)
{
#ifdef STD_EXCEPTION_HAS_STACK_TRACE
    return StackTrace::toString(e.get_stack_trace_frames(), 0, e.get_stack_trace_size());
#else
    if (const auto * db_exception = dynamic_cast<const Exception *>(&e))
        return db_exception->getStackTraceString();
    return {};
#endif
}
std::string getExceptionStackTraceString(std::exception_ptr e)