Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
1000ad429c30
Commit
1000ad42
authored
Mar 01, 2017
by
Sean McGivern
Browse files
Enable and autocorrect the CustomErrorClass cop
parent
c8efec8d1471
Changes
41
Hide whitespace changes
Inline
Side-by-side
app/controllers/projects/blob_controller.rb
View file @
1000ad42
...
...
@@ -5,7 +5,7 @@
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!
...
...
app/models/project.rb
View file @
1000ad42
...
...
@@ -19,7 +19,7 @@
extend
Gitlab
::
ConfigHelper
class
BoardLimitExceeded
<
StandardError
;
end
BoardLimitExceeded
=
Class
.
new
(
StandardError
)
NUMBER_OF_PERMITTED_BOARDS
=
1
UNKNOWN_IMPORT_URL
=
'http://unknown.git'
.
freeze
...
...
app/models/project_wiki.rb
View file @
1000ad42
...
...
@@ -7,7 +7,7 @@
'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.
...
...
app/serializers/pipeline_serializer.rb
View file @
1000ad42
class
PipelineSerializer
<
BaseSerializer
class
InvalidResourceError
<
StandardError
;
end
InvalidResourceError
=
Class
.
new
(
StandardError
)
entity
PipelineEntity
...
...
app/services/commits/change_service.rb
View file @
1000ad42
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
...
...
app/services/files/base_service.rb
View file @
1000ad42
module
Files
class
BaseService
<
::
BaseService
class
ValidationError
<
StandardError
;
end
ValidationError
=
Class
.
new
(
StandardError
)
def
execute
@start_project
=
params
[
:start_project
]
||
@project
...
...
app/services/files/multi_service.rb
View file @
1000ad42
module
Files
class
MultiService
<
Files
::
BaseService
class
FileChangedError
<
StandardError
;
end
FileChangedError
=
Class
.
new
(
StandardError
)
ACTIONS
=
%w[create update delete move]
.
freeze
...
...
app/services/files/update_service.rb
View file @
1000ad42
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
,
...
...
app/services/issues/move_service.rb
View file @
1000ad42
module
Issues
class
MoveService
<
Issues
::
BaseService
class
MoveError
<
StandardError
;
end
MoveError
=
Class
.
new
(
StandardError
)
def
execute
(
issue
,
new_project
)
@old_issue
=
issue
...
...
app/services/merge_requests/resolve_service.rb
View file @
1000ad42
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
...
...
app/services/projects/destroy_service.rb
View file @
1000ad42
...
...
@@ -2,7 +2,7 @@
class
DestroyService
<
BaseService
include
Gitlab
::
ShellAdapter
class
DestroyError
<
StandardError
;
end
DestroyError
=
Class
.
new
(
StandardError
)
DELETED_FLAG
=
'+deleted'
.
freeze
...
...
app/services/projects/import_service.rb
View file @
1000ad42
...
...
@@ -2,7 +2,7 @@
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?
...
...
app/services/projects/transfer_service.rb
View file @
1000ad42
...
...
@@ -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
)
...
...
lib/api/api_guard.rb
View file @
1000ad42
...
...
@@ -160,13 +160,10 @@
# Exceptions
#
class
MissingTokenError
<
StandardError
;
end
class
TokenNotFoundError
<
StandardError
;
end
class
ExpiredError
<
StandardError
;
end
class
RevokedError
<
StandardError
;
end
MissingTokenError
=
Class
.
new
(
StandardError
)
TokenNotFoundError
=
Class
.
new
(
StandardError
)
ExpiredError
=
Class
.
new
(
StandardError
)
RevokedError
=
Class
.
new
(
StandardError
)
class
InsufficientScopeError
<
StandardError
attr_reader
:scopes
...
...
lib/bitbucket/error/unauthorized.rb
View file @
1000ad42
module
Bitbucket
module
Error
class
Unauthorized
<
StandardError
end
Unauthorized
=
Class
.
new
(
StandardError
)
end
end
lib/ci/gitlab_ci_yaml_processor.rb
View file @
1000ad42
module
Ci
class
GitlabCiYamlProcessor
class
ValidationError
<
StandardError
;
end
ValidationError
=
Class
.
new
(
StandardError
)
include
Gitlab
::
Ci
::
Config
::
Entry
::
LegacyValidationHelpers
...
...
lib/extracts_path.rb
View file @
1000ad42
...
...
@@ -2,7 +2,7 @@
# file path string when combined in a request parameter
module
ExtractsPath
# Raised when given an invalid file path
class
InvalidPathError
<
StandardError
;
end
InvalidPathError
=
Class
.
new
(
StandardError
)
# Given a string containing both a Git tree-ish, such as a branch or tag, and
# a filesystem path joined by forward slashes, attempts to separate the two.
...
...
lib/gitlab/access.rb
View file @
1000ad42
...
...
@@ -5,7 +5,7 @@
#
module
Gitlab
module
Access
class
AccessDeniedError
<
StandardError
;
end
AccessDeniedError
=
Class
.
new
(
StandardError
)
NO_ACCESS
=
0
GUEST
=
10
...
...
lib/gitlab/auth.rb
View file @
1000ad42
module
Gitlab
module
Auth
class
MissingPersonalTokenError
<
StandardError
;
end
MissingPersonalTokenError
=
Class
.
new
(
StandardError
)
SCOPES
=
[
:api
,
:read_user
].
freeze
DEFAULT_SCOPES
=
[
:api
].
freeze
...
...
lib/gitlab/ci/build/artifacts/metadata.rb
View file @
1000ad42
...
...
@@ -6,7 +6,7 @@
module
Build
module
Artifacts
class
Metadata
class
ParserError
<
StandardError
;
end
ParserError
=
Class
.
new
(
StandardError
)
VERSION_PATTERN
=
/^[\w\s]+(\d+\.\d+\.\d+)/
INVALID_PATH_PATTERN
=
%r{(^
\.
?
\.
?/)|(/
\.
?
\.
?/)}
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment