<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/errors.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -17,7 +17,7 @@ namespace :gem do
   end
 
   task :install =&gt; :build do
-    `sudo gem install pkg/mandy-*.gem`
+    `sudo gem install pkg/mandy-*.gem --no-rdoc --no-ri`
   end
   
   task :push =&gt; :build do</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ puts &quot;Packaging Gems for distribution...&quot;
 payload = Mandy::Packer.pack(file, options.payload || ARGV[0], gemfile(options.gemfile))
 cmdenv = options.cmdenv
 
-at_exit do 
+at_exit do
   puts &quot;Cleaning up...&quot;
   Mandy::Packer.cleanup!(payload)
   puts &quot;All done!&quot;
@@ -66,32 +66,35 @@ puts &quot;Loading Mandy scripts...&quot;
 require absolute_path(file)
 
 output = nil
-
-puts &quot;Sending jobs to Hadoop...&quot;
-
-Mandy::Job.jobs.each_with_index do |job, i|
-  
-  jobconf = job.settings.map { |key, value| %(-D #{key}='#{value}') }.join(' ')
-  output = File.join(output_folder, &quot;#{i+1}-#{job.name.downcase.gsub(/\W/, '-')}&quot;)
+begin
+  Mandy::Job.jobs.each_with_index do |job, i|
+    puts &quot;Running Job [#{i+1}] #{job.name}...&quot;
+    
+    jobconf = job.settings.map { |key, value| %(-D #{key}='#{value}') }.join(' ')
+    output = File.join(output_folder, &quot;#{i+1}-#{job.name.downcase.gsub(/\W/, '-')}&quot;)
   
-  bootstrap_file = File.expand_path(File.join(File.dirname(__FILE__), '..', 'bootstrap.rb'))
-  inputreader = job.input_format == :xml ? &quot;StreamXmlRecordReader,begin=&lt;#{job.input_format_options[:xml_tag]} ,end=&lt;/#{job.input_format_options[:xml_tag]}&gt;&quot; : nil
+    bootstrap_file = File.expand_path(File.join(File.dirname(__FILE__), '..', 'bootstrap.rb'))
+    inputreader = job.input_format == :xml ? &quot;StreamXmlRecordReader,begin=&lt;#{job.input_format_options[:xml_tag]} ,end=&lt;/#{job.input_format_options[:xml_tag]}&gt;&quot; : nil
   
-  command = %($HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/contrib/streaming/hadoop-*-streaming.jar #{jobconf}\
-                  -files &quot;#{payload}&quot;,&quot;#{bootstrap_file}&quot; \
-                  -conf '#{config}' \
-                  -input &quot;#{input}&quot;  \
-                  #{ inputreader.nil? ? '' : &quot;-inputreader \&quot;#{inputreader}\&quot;&quot; } \
-                  -mapper &quot;ruby bootstrap.rb #{File.basename(payload)} map #{filename} '#{job.name}'&quot;  \
-                  -reducer &quot;ruby bootstrap.rb #{File.basename(payload)} reduce #{filename} '#{job.name}'&quot;  \
-                  #{ cmdenv.nil? ? '' : &quot;-cmdenv #{cmdenv}&quot; }\
-                  -output &quot;#{output}&quot;)
+    command = %($HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/contrib/streaming/hadoop-*-streaming.jar #{jobconf}\
+                    -files &quot;#{payload}&quot;,&quot;#{bootstrap_file}&quot; \
+                    -conf '#{config}' \
+                    -input &quot;#{input}&quot;  \
+                    #{ inputreader.nil? ? '' : &quot;-inputreader \&quot;#{inputreader}\&quot;&quot; } \
+                    -mapper &quot;ruby bootstrap.rb #{File.basename(payload)} map #{filename} '#{job.name}'&quot;  \
+                    -reducer &quot;ruby bootstrap.rb #{File.basename(payload)} reduce #{filename} '#{job.name}'&quot;  \
+                    #{ cmdenv.nil? ? '' : &quot;-cmdenv #{cmdenv}&quot; }\
+                    -output &quot;#{output}&quot; 2&gt;&amp;1)
 
-  `#{command}`
+    result = `#{command}`
+    raise(Mandy::HadoopJobFailure.new(job, result)) unless $?.to_i==0
 
-  # puts &quot;#{command}&quot;
-  input = output
-end
-
-# print out the output location so caller can know where to get the results from
-puts output
\ No newline at end of file
+    # puts &quot;#{command}&quot;
+    input = output
+  end
+  # print out the output location so caller can know where to get the results from
+  puts output
+rescue Mandy::HadoopJobFailure =&gt; e
+  STDERR.puts e.to_s
+  exit(1)
+end
\ No newline at end of file</diff>
      <filename>bin/mandy-hadoop</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ require &quot;cgi&quot;
   stores/in_memory
   test_runner
   ruby-hbase
+  errors
 ).each {|file| require File.join(File.dirname(__FILE__), file) }
 
 module Mandy</diff>
      <filename>lib/mandy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
   s.version = File.read(File.join(File.dirname(__FILE__),'VERSION'))
   s.date = '2009-10-19'
 
-  s.description = &quot;Map/Reduce&quot;
-  s.summary     = &quot;Map/Reduce&quot;
+  s.description = &quot;Mandy is Ruby Map/Reduce Framework built onto of the Hadoop Distributed computing platform.&quot;
+  s.summary     = &quot;Map/Reduce Framework&quot;
 
   s.authors = [&quot;Andy Kent&quot;, &quot;Paul Ingles&quot;]
   s.email = &quot;andy.kent@me.com&quot;
@@ -53,6 +53,7 @@ Gem::Specification.new do |s|
     Rakefile
     bootstrap.rb
     geminstaller.yml
+    lib/errors.rb
     lib/mandy.rb
     lib/support/tuple.rb
     lib/support/formatting.rb</diff>
      <filename>mandy.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>498c0292184c21555d7bc19fc2955b91060c2f5c</id>
    </parent>
  </parents>
  <author>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </author>
  <url>http://github.com/trafficbroker/mandy/commit/02b3dfbeb681721745616bc0449fa862ec22fc9d</url>
  <id>02b3dfbeb681721745616bc0449fa862ec22fc9d</id>
  <committed-date>2009-10-21T03:23:18-07:00</committed-date>
  <authored-date>2009-10-21T03:23:18-07:00</authored-date>
  <message>much better hadoop error handling, we now return a non zero status code from the command line and print the important info to STDERR</message>
  <tree>a3b7e5629e9ea0f826eb0f41a5a642f601eeff99</tree>
  <committer>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </committer>
</commit>
