Created
September 2, 2016 03:15
-
-
Save siassaj/cc974d1b5731b42803540b89b27c1f73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
raise PromisePayableCompany::CouldntCreateBankAccountError, @company | |
user = @company.users.first | |
pp_company = PromisePayableCompany.new(@company, user) | |
pp_company.maybe_attach_user | |
pp_company.maybe_attach_company | |
rescue PromisePayableCompany::CouldntCreateUserError => e | |
Rails.logger.error e | |
Raven.capture_exception(e) | |
flash[:alert] = "There was a problem registering your company with Promise Pay."\ | |
" We've been notified, but you can also contact us"\ | |
" <a href='/contact'>here</a>." | |
@company.revert_step! | |
rescue PromisePayableCompany::CouldntCreateCompanyError => e | |
Rails.logger.error e | |
Raven.capture_exception(e) | |
flash[:alert] = "There was a problem registering your company with Promise Pay."\ | |
" We've been notified, but you can also contact us"\ | |
" <a href='/contact'>here</a>." | |
@company.revert_step! | |
rescue PromisePayableCompany::CouldntCreateBankAccountError => e | |
Rails.logger.error e | |
Raven.capture_exception(e) | |
flash[:alert] = "There was a problem registering your company with Promise Pay."\ | |
" We've been notified, but you can also contact us"\ | |
" <a href='/contact'>here</a>." | |
@company.revert_step! | |
rescue Faraday::ConnectionFailed => e | |
Rails.logger.error e | |
Raven.capture_exception(e) | |
flash[:alert] = "There was a problem connecting to Promise Pay to set up your"\ | |
" account. It's most likely a network issue. Please try again"\ | |
" in a few minutes." | |
@company.revert_step! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment