Commit 097eafc8 authored by James Lopez's avatar James Lopez Committed by Robert Speicher

fix some issues and improved error output for forking

parent 64c39055
...@@ -1019,7 +1019,14 @@ class Project < ActiveRecord::Base ...@@ -1019,7 +1019,14 @@ class Project < ActiveRecord::Base
end end
def mark_import_as_failed(error_message) def mark_import_as_failed(error_message)
original_errors = errors.dup
sanitized_message = Gitlab::UrlSanitizer.sanitize(error_message)
import_fail import_fail
update_column(:import_error, Gitlab::UrlSanitizer.sanitize(error_message)) update_column(:import_error, sanitized_message)
rescue ActiveRecord::ActiveRecordError => e
Rails.logger.error("Error setting import status to failed: #{e.message}. Original error: #{sanitized_message}")
ensure
@errors = original_errors
end end
end end
...@@ -59,7 +59,7 @@ module Projects ...@@ -59,7 +59,7 @@ module Projects
if @project.errors.empty? if @project.errors.empty?
@project.add_import_job if @project.import? @project.add_import_job if @project.import?
else else
fail(error: @project.errors.join(', ')) fail(error: @project.errors.full_messages.join(', '))
end end
@project @project
rescue => e rescue => e
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment