Class: Jira::Requests::Base
- Inherits:
-
Object
- Object
- Jira::Requests::Base
- Includes:
- SafeFormatHelper
- Defined in:
- app/services/jira/requests/base.rb
Direct Known Subclasses
Constant Summary collapse
- JIRA_API_VERSION =
2- JIRA_ERROR_JSON_SIZE_LIMIT =
Limit the size of the JSON error message we will attempt to parse, as the JSON is external input.
5_000- ERRORS =
{ connection: [Errno::ECONNRESET, Errno::ECONNREFUSED], jira_ruby: JIRA::HTTPError, ssl: OpenSSL::SSL::SSLError, timeout: [Timeout::Error, Errno::ETIMEDOUT], uri: [URI::InvalidURIError, SocketError], url_blocked: Gitlab::HTTP::BlockedUrlError }.freeze
- ALL_ERRORS =
ERRORS.values.flatten.freeze
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(jira_integration, params = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from SafeFormatHelper
Constructor Details
#initialize(jira_integration, params = {}) ⇒ Base
Returns a new instance of Base.
22 23 24 25 |
# File 'app/services/jira/requests/base.rb', line 22 def initialize(jira_integration, params = {}) @project = jira_integration&.project @jira_integration = jira_integration end |
Instance Method Details
#execute ⇒ Object
27 28 29 30 31 |
# File 'app/services/jira/requests/base.rb', line 27 def execute return ServiceResponse.error(message: _('Jira service not configured.')) unless jira_integration&.active? request end |