lib/learn_open/opener.rb in learn-open-1.1.0 vs lib/learn_open/opener.rb in learn-open-1.1.1
- old
+ new
@@ -85,10 +85,11 @@
if retries > 0
puts "There was a problem getting your lesson from Learn. Retrying..."
get_current_lesson_forked_repo(retries-1)
else
puts "There seems to be a problem connecting to Learn. Please try again."
+ File.write(file_path, 'ERROR: Error connecting to Learn')
exit
end
end
end
@@ -101,10 +102,11 @@
if retries > 0
puts "There was a problem getting your next lesson from Learn. Retrying..."
get_next_lesson_forked_repo(retries-1)
else
puts "There seems to be a problem connecting to Learn. Please try again."
+ File.write(file_path, 'ERROR: Error connecting to Learn')
exit
end
end
end
@@ -121,10 +123,11 @@
if retries > 0
puts "There was a problem connecting to Learn. Retrying..."
correct_lesson(retries-1)
else
puts "Cannot connect to Learn right now. Please try again."
+ File.write(file_path, 'ERROR: Error connecting to Learn')
exit
end
end
end
@@ -140,10 +143,11 @@
if retries > 0
puts "There was a problem forking this lesson. Retrying..."
fork_repo(retries-1)
else
puts "There is an issue connecting to Learn. Please try again."
+ File.write(file_path, 'ERROR: Error connecting to Learn')
exit
end
end
end
end
@@ -160,10 +164,11 @@
if retries > 0
puts "There was a problem cloning this lesson. Retrying..."
clone_repo(retries-1)
else
puts "Cannot clone this lesson right now. Please try again."
+ File.write(file_path, 'ERROR: Error cloning. Try again.')
exit
end
end
end
end
@@ -188,10 +193,12 @@
ios_lang || xcodeproj_file? || xcworkspace_file?
rescue Psych::SyntaxError
if xcodeproj_file? || xcworkspace_file?
true
else
- puts "There seems to be a problem with this lesson. Please submit a bug report to bugs@learn.co. If you'd like to work on your next lesson, type: learn next"
+ puts "Sorry, there seems to be a problem with this lesson. Please submit a bug report to bugs@learn.co and try again later."
+ puts "If you'd like to work on your next lesson now, type: learn next"
+ File.write(file_path, 'ERROR: Problem parsing lesson data. Try again.')
exit
end
end
end