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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
b2b2b2f9
Commit
b2b2b2f9
authored
8 years ago
by
James Lopez
Committed by
Robert Speicher
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix create service error handling - missing setting import status to failed
parent
74849f97
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+20
-6
No files found.
app/services/projects/create_service.rb
View file @
b2b2b2f9
...
...
@@ -56,14 +56,14 @@ module Projects
after_create_actions
if
@project
.
persisted?
@project
.
add_import_job
if
@project
.
import?
if
@project
.
errors
.
empty?
@project
.
add_import_job
if
@project
.
import?
else
fail
(
error:
@project
.
errors
.
join
(
', '
))
end
@project
rescue
=>
e
message
=
"Unable to save project:
#{
e
.
message
}
"
Rails
.
logger
.
error
(
message
)
@project
.
errors
.
add
(
:base
,
message
)
if
@project
@project
fail
(
error:
e
.
message
)
end
protected
...
...
@@ -103,5 +103,19 @@ module Projects
end
end
end
def
fail
(
error
:)
message
=
"Unable to save project. Error:
#{
error
}
"
message
<<
"Project ID:
#{
@project
.
id
}
"
if
@project
&&
@project
.
id
Rails
.
logger
.
error
(
message
)
if
@project
&&
@project
.
import?
@project
.
errors
.
add
(
:base
,
message
)
@project
.
mark_import_as_failed
(
message
)
end
@project
end
end
end
This diff is collapsed.
Click to expand it.
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