Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b58a2e30
Commit
b58a2e30
authored
Jan 22, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap errors on GitHub importer to raise Projects::ImportService::Error
parent
c0403234
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
lib/gitlab/bitbucket_import/importer.rb
lib/gitlab/bitbucket_import/importer.rb
+2
-0
lib/gitlab/github_import/importer.rb
lib/gitlab/github_import/importer.rb
+10
-7
No files found.
lib/gitlab/bitbucket_import/importer.rb
View file @
b58a2e30
...
@@ -16,6 +16,8 @@ module Gitlab
...
@@ -16,6 +16,8 @@ module Gitlab
import_issues
if
has_issues?
import_issues
if
has_issues?
true
true
rescue
ActiveRecord
::
RecordInvalid
=>
e
raise
Projects
::
ImportService
::
Error
.
new
,
e
.
message
ensure
ensure
Gitlab
::
BitbucketImport
::
KeyDeleter
.
new
(
project
).
execute
Gitlab
::
BitbucketImport
::
KeyDeleter
.
new
(
project
).
execute
end
end
...
...
lib/gitlab/github_import/importer.rb
View file @
b58a2e30
...
@@ -35,8 +35,8 @@ module Gitlab
...
@@ -35,8 +35,8 @@ module Gitlab
end
end
true
true
rescue
ActiveRecord
::
RecordInvalid
rescue
ActiveRecord
::
RecordInvalid
=>
e
fals
e
raise
Projects
::
ImportService
::
Error
,
e
.
messag
e
end
end
def
import_pull_requests
def
import_pull_requests
...
@@ -53,8 +53,8 @@ module Gitlab
...
@@ -53,8 +53,8 @@ module Gitlab
end
end
true
true
rescue
ActiveRecord
::
RecordInvalid
rescue
ActiveRecord
::
RecordInvalid
=>
e
fals
e
raise
Projects
::
ImportService
::
Error
,
e
.
messag
e
end
end
def
import_comments
(
issue_number
,
noteable
)
def
import_comments
(
issue_number
,
noteable
)
...
@@ -83,10 +83,13 @@ module Gitlab
...
@@ -83,10 +83,13 @@ module Gitlab
true
true
rescue
Gitlab
::
Shell
::
Error
=>
e
rescue
Gitlab
::
Shell
::
Error
=>
e
if
e
.
message
=~
/repository not exported/
# GitHub error message when the wiki repo has not been created,
true
# this means that repo has wiki enabled, but have no pages. So,
# we can skip the import.
if
e
.
message
!~
/repository not exported/
raise
Projects
::
ImportService
::
Error
,
e
.
message
else
else
fals
e
tru
e
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
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