diff options
Diffstat (limited to 'app/serializers/project_import_entity.rb')
-rw-r--r-- | app/serializers/project_import_entity.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/serializers/project_import_entity.rb b/app/serializers/project_import_entity.rb index a3dbff3dc0b..58360321f7c 100644 --- a/app/serializers/project_import_entity.rb +++ b/app/serializers/project_import_entity.rb @@ -12,4 +12,8 @@ class ProjectImportEntity < ProjectEntity expose :provider_link, documentation: { type: 'string', example: '/source/source-repo' } do |project, options| provider_project_link_url(options[:provider_url], project[:import_source]) end + + expose :import_error, if: ->(project) { project.import_state&.failed? } do |project| + project.import_failures.last&.exception_message + end end |