diff options
author | James Lopez <james@jameslopez.es> | 2016-05-31 14:53:33 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-06-02 21:48:26 -0400 |
commit | 097eafc8c74f97912a52399d422fb24be84e734d (patch) | |
tree | 746e9772ba5d1279b780b9fe492d3d5cf4a743f8 /app | |
parent | 64c3905523808942ac62b7ebfbce3634b6e9dc17 (diff) | |
download | gitlab-ce-097eafc8c74f97912a52399d422fb24be84e734d.tar.gz |
fix some issues and improved error output for forking
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 9 | ||||
-rw-r--r-- | app/services/projects/create_service.rb | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 03429fb7a46..e4a9d17a20c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1019,7 +1019,14 @@ class Project < ActiveRecord::Base end def mark_import_as_failed(error_message) + original_errors = errors.dup + sanitized_message = Gitlab::UrlSanitizer.sanitize(error_message) + 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 diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index b73389f0489..61cac5419ad 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -59,7 +59,7 @@ module Projects if @project.errors.empty? @project.add_import_job if @project.import? else - fail(error: @project.errors.join(', ')) + fail(error: @project.errors.full_messages.join(', ')) end @project rescue => e |