mirror of
https://github.com/ViViDboarder/abuse-the-force.git
synced 2024-11-23 15:36:27 +00:00
Add a little error handling
This commit is contained in:
parent
2e9bce3509
commit
37be12dee1
@ -57,19 +57,23 @@ module AbuseTheForce
|
|||||||
|
|
||||||
manifest = Metaforce::Manifest.new(metadata_type => [full_name])
|
manifest = Metaforce::Manifest.new(metadata_type => [full_name])
|
||||||
|
|
||||||
|
begin
|
||||||
@client.retrieve_unpackaged(manifest).
|
@client.retrieve_unpackaged(manifest).
|
||||||
extract_to(Atf_Config.get_project_path).
|
extract_to(Atf_Config.get_project_path).
|
||||||
on_complete { |job| puts "Finished retrieve #{job.id}!" }.
|
on_complete { |job| puts "Finished retrieve #{job.id}!" }.
|
||||||
on_error { |job| puts "Something bad happened!" }.
|
on_error { |job| puts "Something bad happened!" }.
|
||||||
on_poll { |job| puts "Polling for #{job.id}!" }.
|
on_poll { |job| puts "Polling for #{job.id}!" }.
|
||||||
perform
|
perform
|
||||||
|
rescue
|
||||||
|
puts "An error ocurred."
|
||||||
|
ensure
|
||||||
# Restore old Manifest
|
# Restore old Manifest
|
||||||
FileUtils.move(
|
FileUtils.move(
|
||||||
File.join(Atf_Config.get_project_path, 'package.xml-bak'),
|
File.join(Atf_Config.get_project_path, 'package.xml-bak'),
|
||||||
File.join(Atf_Config.get_project_path, 'package.xml')
|
File.join(Atf_Config.get_project_path, 'package.xml')
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Fetches a whole project from the server
|
# Fetches a whole project from the server
|
||||||
def self.retrieve_project()
|
def self.retrieve_project()
|
||||||
|
Loading…
Reference in New Issue
Block a user