diff options
author | Sean McGivern <sean@gitlab.com> | 2017-03-01 11:00:37 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-03-01 15:28:10 +0000 |
commit | 811e598f607235d89e71d09d99538ee4dee3ffed (patch) | |
tree | 7608961ebb9c672836dd2e3f03eb56920e7b4ef3 /app | |
parent | 8dd097a91530e4b047c4b391f21047c7d29d310d (diff) | |
download | gitlab-ce-811e598f607235d89e71d09d99538ee4dee3ffed.tar.gz |
Enable and autocorrect the CustomErrorClass cop
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/models/project_wiki.rb | 2 | ||||
-rw-r--r-- | app/serializers/pipeline_serializer.rb | 2 | ||||
-rw-r--r-- | app/services/commits/change_service.rb | 4 | ||||
-rw-r--r-- | app/services/files/base_service.rb | 2 | ||||
-rw-r--r-- | app/services/files/multi_service.rb | 2 | ||||
-rw-r--r-- | app/services/files/update_service.rb | 2 | ||||
-rw-r--r-- | app/services/issues/move_service.rb | 2 | ||||
-rw-r--r-- | app/services/merge_requests/resolve_service.rb | 3 | ||||
-rw-r--r-- | app/services/projects/destroy_service.rb | 2 | ||||
-rw-r--r-- | app/services/projects/import_service.rb | 2 | ||||
-rw-r--r-- | app/services/projects/transfer_service.rb | 2 |
13 files changed, 14 insertions, 15 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 39ba815cfca..f9a5ef46786 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -5,7 +5,7 @@ class Projects::BlobController < Projects::ApplicationController include ActionView::Helpers::SanitizeHelper # Raised when given an invalid file path - class InvalidPathError < StandardError; end + InvalidPathError = Class.new(StandardError) before_action :require_non_empty_project, except: [:new, :create] before_action :authorize_download_code! diff --git a/app/models/project.rb b/app/models/project.rb index e06fc30dc8a..0c2494d3c32 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -19,7 +19,7 @@ class Project < ActiveRecord::Base extend Gitlab::ConfigHelper - class BoardLimitExceeded < StandardError; end + BoardLimitExceeded = Class.new(StandardError) NUMBER_OF_PERMITTED_BOARDS = 1 UNKNOWN_IMPORT_URL = 'http://unknown.git'.freeze diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 9891f5edf41..539b31780b3 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -7,7 +7,7 @@ class ProjectWiki 'AsciiDoc' => :asciidoc }.freeze unless defined?(MARKUPS) - class CouldNotCreateWikiError < StandardError; end + CouldNotCreateWikiError = Class.new(StandardError) # Returns a string describing what went wrong after # an operation fails. diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index 2bc6cf3266e..ab2d3d5a3ec 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -1,5 +1,5 @@ class PipelineSerializer < BaseSerializer - class InvalidResourceError < StandardError; end + InvalidResourceError = Class.new(StandardError) entity PipelineEntity diff --git a/app/services/commits/change_service.rb b/app/services/commits/change_service.rb index 25e22f14e60..8a9bcd2d053 100644 --- a/app/services/commits/change_service.rb +++ b/app/services/commits/change_service.rb @@ -1,7 +1,7 @@ module Commits class ChangeService < ::BaseService - class ValidationError < StandardError; end - class ChangeError < StandardError; end + ValidationError = Class.new(StandardError) + ChangeError = Class.new(StandardError) def execute @start_project = params[:start_project] || @project diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb index 0a25f56d24c..31869c2f01e 100644 --- a/app/services/files/base_service.rb +++ b/app/services/files/base_service.rb @@ -1,6 +1,6 @@ module Files class BaseService < ::BaseService - class ValidationError < StandardError; end + ValidationError = Class.new(StandardError) def execute @start_project = params[:start_project] || @project diff --git a/app/services/files/multi_service.rb b/app/services/files/multi_service.rb index 0609c6219e7..700f9f4f6f0 100644 --- a/app/services/files/multi_service.rb +++ b/app/services/files/multi_service.rb @@ -1,6 +1,6 @@ module Files class MultiService < Files::BaseService - class FileChangedError < StandardError; end + FileChangedError = Class.new(StandardError) ACTIONS = %w[create update delete move].freeze diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb index 54e1aaf3f67..fbbab97632e 100644 --- a/app/services/files/update_service.rb +++ b/app/services/files/update_service.rb @@ -1,6 +1,6 @@ module Files class UpdateService < Files::BaseService - class FileChangedError < StandardError; end + FileChangedError = Class.new(StandardError) def commit repository.update_file(current_user, @file_path, @file_content, diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb index a2a5f57d069..711f4035c55 100644 --- a/app/services/issues/move_service.rb +++ b/app/services/issues/move_service.rb @@ -1,6 +1,6 @@ module Issues class MoveService < Issues::BaseService - class MoveError < StandardError; end + MoveError = Class.new(StandardError) def execute(issue, new_project) @old_issue = issue diff --git a/app/services/merge_requests/resolve_service.rb b/app/services/merge_requests/resolve_service.rb index d22a1d3e0ad..82cd89d9a0b 100644 --- a/app/services/merge_requests/resolve_service.rb +++ b/app/services/merge_requests/resolve_service.rb @@ -1,7 +1,6 @@ module MergeRequests class ResolveService < MergeRequests::BaseService - class MissingFiles < Gitlab::Conflict::ResolutionError - end + MissingFiles = Class.new(Gitlab::Conflict::ResolutionError) attr_accessor :conflicts, :rugged, :merge_index, :merge_request diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index 2e06826c311..a7142d5950e 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -2,7 +2,7 @@ module Projects class DestroyService < BaseService include Gitlab::ShellAdapter - class DestroyError < StandardError; end + DestroyError = Class.new(StandardError) DELETED_FLAG = '+deleted'.freeze diff --git a/app/services/projects/import_service.rb b/app/services/projects/import_service.rb index cd230528743..1c5a549feb9 100644 --- a/app/services/projects/import_service.rb +++ b/app/services/projects/import_service.rb @@ -2,7 +2,7 @@ module Projects class ImportService < BaseService include Gitlab::ShellAdapter - class Error < StandardError; end + Error = Class.new(StandardError) def execute add_repository_to_project unless project.gitlab_project_import? diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb index 20dfbddc823..da6e6acd4a7 100644 --- a/app/services/projects/transfer_service.rb +++ b/app/services/projects/transfer_service.rb @@ -9,7 +9,7 @@ module Projects class TransferService < BaseService include Gitlab::ShellAdapter - class TransferError < StandardError; end + TransferError = Class.new(StandardError) def execute(new_namespace) if allowed_transfer?(current_user, project, new_namespace) |