app/jobs/assignment_repo/create_github_repository_job.rb
# Given an error, retries the job if retries are positive
# or broadcasts a failure to the user
#
# rubocop:disable MethodLength
Given an error, retries the job if retries are positive
or broadcasts a failure to the user


Given an error retries the job if retries are positive or broadcasts a failure to the user
def handle_error(err, assignment, user, invite_status, retries)
      logger.warn(err.message)
      if retries.positive?
        invite_status.waiting!
        CreateGitHubRepositoryJob.perform_later(assignment, user, retries: retries - 1)
      else
        invite_status.errored_creating_repo!
        broadcast_message(
          type: :error,
          message: err,
          assignment: assignment,
          user: user,
          invite_status: invite_status,
          status_text: "Failed"
        )
        report_error(err)
      end
    end
def handle_error ( err , assignment , user , invite_status , retries ) logger . warn ( err . message ) if retries . positive? invite_status . waiting! CreateGitHubRepositoryJob . perform_later ( assignment , user , retries : retries - 1 ) else invite_status . errored_creating_repo! broadcast_message ( type : :error , message : err , assignment : assignment , user : user , invite_status : invite_status , status_text : "Failed" ) report_error ( err ) end end
Given an error, retries the job if retries are positive
or broadcasts a failure to the user
Given an error retries the job if retries are positive or broadcasts a failure to the user
err
<not_specific>
assignment
<not_specific>
user
<not_specific>
invite_status
<not_specific>
retries
<not_specific>