Skip to content

Commit

Permalink
Return false when a json error happens
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Mar 13, 2019
1 parent 986dd74 commit ba1d1e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/registration/connect_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def self.catch_registration_errors(message_prefix: "",
# update the message when an old SMT server is found
check_smt_api(e.message)
details_error(message_prefix + _("Cannot parse the data from server."), e.message)
false
rescue StandardError => e
log.error("SCC registration failed: #{e.class}: #{e}, #{e.backtrace}")
Yast::Report.Error(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/registration/registration_ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def initialize(registration)
def register_system_and_base_product
product_service = nil
# TRANSLATORS: Popup error message prefix
error_options = { message_prefix: _("Registration failed.") }
error_options = { message_prefix: _("Registration failed.") + "\n\n" }

success = ConnectHelpers.catch_registration_errors(error_options) do
register_system if !Registration.is_registered?
Expand Down

0 comments on commit ba1d1e0

Please sign in to comment.