rapid7 / rex-core

Created by David Maloney via the GitHub Connector
Other
4 stars 23 forks source link

Allow developer configurable messages in exceptions #33

Closed adfoster-r7 closed 1 year ago

adfoster-r7 commented 1 year ago

Spotted as part of https://github.com/rapid7/metasploit-framework/pull/17455 Similar PR that was implemented in framework way-back-when: https://github.com/rapid7/metasploit-framework/pull/13367

Before

Developer provided messages in exceptions are ignored:

$ bundle exec ruby -e 'require "rex/exceptions"; puts Rex::TimeoutError.new("Kerberos Client: failed to read response length due to timeout").to_s'
Operation timed out.

After

Developer provided messages in exceptions are correctly tracked

$ bundle exec ruby -e 'require "rex/exceptions"; puts Rex::TimeoutError.new("Kerberos Client: failed to read response length due to timeout").to_s'
Kerberos Client: failed to read response length due to timeout