[BB Importer] Save the error trace and the whole raw document
This commit is contained in:
parent
3082a1195c
commit
3bc114a7c1
3 changed files with 9 additions and 6 deletions
5
changelogs/unreleased/bb_save_trace.yml
Normal file
5
changelogs/unreleased/bb_save_trace.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: "[BB Importer] Save the error trace and the whole raw document to debug problems
|
||||
easier"
|
||||
merge_request:
|
||||
author:
|
|
@ -1,6 +1,8 @@
|
|||
module Bitbucket
|
||||
module Representation
|
||||
class Base
|
||||
attr_reader :raw
|
||||
|
||||
def initialize(raw)
|
||||
@raw = raw
|
||||
end
|
||||
|
@ -8,10 +10,6 @@ module Bitbucket
|
|||
def self.decorate(entries)
|
||||
entries.map { |entry| new(entry)}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
attr_reader :raw
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -149,7 +149,7 @@ module Gitlab
|
|||
description += @formatter.author_line(pull_request.author) unless find_user_id(pull_request.author)
|
||||
description += pull_request.description
|
||||
|
||||
merge_request = project.merge_requests.create(
|
||||
merge_request = project.merge_requests.create!(
|
||||
iid: pull_request.iid,
|
||||
title: pull_request.title,
|
||||
description: description,
|
||||
|
@ -168,7 +168,7 @@ module Gitlab
|
|||
|
||||
import_pull_request_comments(pull_request, merge_request) if merge_request.persisted?
|
||||
rescue StandardError => e
|
||||
errors << { type: :pull_request, iid: pull_request.iid, errors: e.message }
|
||||
errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, trace: e.backtrace.join("\n"), raw_response: pull_request.raw }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue