Sha256: d2cbf7e18a75d23f3a3ea609ee16318aa0346866234cc22fbbe552fc7d275823

Contents?: true

Size: 926 Bytes

Versions: 1

Compression:

Stored size: 926 Bytes

Contents

module RocketJobMissionControl
  module Jobs
    class FailuresController < RocketJobMissionControl::ApplicationController
      def index
        job_failures = JobFailures.new(params[:job_id])
        @job  = job_failures.job

        if @job && @job.failed?
          @slice_errors = job_failures.list
          @error_type   = params[:error_type] || @slice_errors.first['_id']['error_class']

          offset             = params.fetch(:offset, 1).to_i
          selected_exception = job_failures.for_error(@error_type, offset)
          current_failure    = selected_exception.first

          @pagination = {
            offset: offset,
            total:  (selected_exception.count - 1),
          }

          if current_failure.present?
            @failure_exception = current_failure['exception']
          end

        else
          redirect_to(job_path(params[:job_id]))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rocketjob_mission_control-1.2.0 app/controllers/rocket_job_mission_control/jobs/failures_controller.rb