Class: CommitStatusPresenter

Inherits:
Gitlab::View::Presenter::Delegated show all
Defined in:
app/presenters/commit_status_presenter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gitlab::View::Presenter::Delegated

#initialize

Methods included from Gitlab::Utils::DelegatorOverride

#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!

Methods included from Gitlab::View::Presenter::Base

#__subject__, #can?, #declarative_policy_delegate, #is_a?, #path_with_line_numbers, #present, #url_builder, #web_path, #web_url

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Methods included from Gitlab::Routing

includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

This class inherits a constructor from Gitlab::View::Presenter::Delegated

Class Method Details

.callout_failure_messagesObject



50
51
52
# File 'app/presenters/commit_status_presenter.rb', line 50

def self.callout_failure_messages
  CALLOUT_FAILURE_MESSAGES
end

Instance Method Details

#callout_failure_messageObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'app/presenters/commit_status_presenter.rb', line 54

def callout_failure_message
  failure_reason.to_sym.then do |failure_reason|
    message = self.class.callout_failure_messages.fetch(failure_reason)

    # Include custom error message from job_messages only for job_router_failure
    message = "#{message} #{job_router_failure_msg}" if failure_reason == :job_router_failure

    if doc_link = troubleshooting_doc[failure_reason]
      message += " #{help_page_link(doc_link)}"
    end

    message
  end
end