Skip to content
Snippets Groups Projects
Unverified Commit 93d34aad authored by Samuel Couillard's avatar Samuel Couillard Committed by GitHub
Browse files

Add Errors Logs to Migration (v2) (#4678)

* Add Errors logging to Migration (v2)

* Improve error logging

* rubo

* Fix last line removal mistake
parent 83bb0a92
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ namespace :migrations do ...@@ -45,6 +45,7 @@ namespace :migrations do
puts red "Unable to migrate Role:" puts red "Unable to migrate Role:"
puts yellow "ID: #{r.id}" puts yellow "ID: #{r.id}"
puts yellow "Name: #{params[:role][:name]}" puts yellow "Name: #{params[:role][:name]}"
puts red "Errors: #{JSON.parse(response.body.to_s)['errors']}"
has_encountred_issue = 1 # At least one of the migrations failed. has_encountred_issue = 1 # At least one of the migrations failed.
end end
end end
...@@ -78,6 +79,7 @@ namespace :migrations do ...@@ -78,6 +79,7 @@ namespace :migrations do
puts red "Unable to migrate User:" puts red "Unable to migrate User:"
puts yellow "UID: #{u.uid}" puts yellow "UID: #{u.uid}"
puts yellow "Name: #{params[:user][:name]}" puts yellow "Name: #{params[:user][:name]}"
puts red "Errors: #{JSON.parse(response.body.to_s)['errors']}"
has_encountred_issue = 1 # At least one of the migrations failed. has_encountred_issue = 1 # At least one of the migrations failed.
end end
end end
...@@ -142,6 +144,7 @@ namespace :migrations do ...@@ -142,6 +144,7 @@ namespace :migrations do
puts red "Unable to migrate Room:" puts red "Unable to migrate Room:"
puts yellow "UID: #{r.uid}" puts yellow "UID: #{r.uid}"
puts yellow "Name: #{r.name}" puts yellow "Name: #{r.name}"
puts red "Errors: #{JSON.parse(response.body.to_s)['errors']}"
has_encountred_issue = 1 # At least one of the migrations failed. has_encountred_issue = 1 # At least one of the migrations failed.
end end
end end
...@@ -192,6 +195,7 @@ namespace :migrations do ...@@ -192,6 +195,7 @@ namespace :migrations do
puts green "Successfully migrated Settings" puts green "Successfully migrated Settings"
else else
puts red "Unable to migrate Settings" puts red "Unable to migrate Settings"
puts red "Errors: #{JSON.parse(response.body.to_s)['errors']}"
has_encountred_issue = 1 # At least one of the migrations failed. has_encountred_issue = 1 # At least one of the migrations failed.
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment