diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a2fd74ac..4b985c76 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -62,7 +62,12 @@ def check_init rescue => exception @settings.update_attribute :initialized_flag, false sign_out current_user - redirect_to new_user_registration_url, :flash => { :error => "An error occurred, please contact team@crowdhoster.com: #{exception.message}" } + if(exception.message == "Invalid credentials" && Rails.env.development?) + errorMsg = 'Invalid credentials, check Crowdtilt API Key and API Secret' + else + errorMsg = exception.message + end + redirect_to new_user_registration_url, :flash => { :error => "An error occurred, please contact team@crowdhoster.com: #{errorMsg}" } return else @settings.update_attribute :ct_sandbox_guest_id, sandbox_guest['user']['id']