class HammerCLIForemanOpenscap::ExceptionHandler
Public Instance Methods
mappings()
click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman_openscap/exception_handler.rb, line 3 def mappings [ [RestClient::InternalServerError, :handle_internal_error], [RestClient::UnprocessableEntity, :handle_unprocessable_entity], [HammerCLIForemanOpenscap::DownloadError, :handle_download_error] ] + super end
Protected Instance Methods
handle_download_error(e)
click to toggle source
# File lib/hammer_cli_foreman_openscap/exception_handler.rb, line 13 def handle_download_error(e) print_error e.message log_full_error e end
handle_internal_error(e)
click to toggle source
# File lib/hammer_cli_foreman_openscap/exception_handler.rb, line 18 def handle_internal_error(e) handle_scap_error(e) HammerCLI::EX_SOFTWARE end
handle_scap_error(e)
click to toggle source
# File lib/hammer_cli_foreman_openscap/exception_handler.rb, line 28 def handle_scap_error(e) response = JSON.parse(e.response) response = HammerCLIForeman.record_to_common_format(response) print_error(response["message"] || response["full_messages"]) log_full_error e end
handle_unprocessable_entity(e)
click to toggle source
# File lib/hammer_cli_foreman_openscap/exception_handler.rb, line 23 def handle_unprocessable_entity(e) handle_scap_error(e) HammerCLI::EX_DATAERR end