<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -52,10 +52,40 @@ module Devpay #:nodoc:
               Devpay::Errors::LicenseService::UserNotSubscribed
         ActivationResponse.new({
           :code     =&gt; $!.class.to_s,
-          :message  =&gt; $!.message
+          :message  =&gt; custom_message_for($!) || $!.message
         })
       end
       
+      
+      private
+      
+      
+      ##
+      # Inherit this class into a custom requestor class and override this 
+      # method to return custom error messages for error codes.
+      #
+      # ===== Example
+      #
+      # Below is an example of how to add custom error messages to your 
+      # application through the response messages:
+      #
+      #     def self.custom_devpay_message_for(error)
+      #       case error
+      #       when Devpay::Errors::LicenseService::ExpiredActivationKey
+      #         %w(
+      #         The activation key you've provided has expired.  Please go
+      #         to your Amazon activation page and generate a new activation
+      #         key.
+      #         )
+      #       else
+      #         nil  # Uses the Amazon error message.
+      #       end
+      #     end
+      #
+      def self.custom_message_for(error)
+        nil
+      end
+      
     end
     
   end</diff>
      <filename>lib/devpay/helpers/graceful_requestor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -57,7 +57,18 @@ class GracefulRequestorTest &lt; Test::Unit::TestCase
           
         end
         
-        
+        context &quot;with custom messages&quot; do
+          
+          setup do
+            @requestor.stubs(:custom_message_for).returns(&quot;Custom error message&quot;)
+          end
+          
+          should &quot;return the custom message&quot; do
+            assert_equal &quot;Custom error message&quot;, @requestor.activate!(TEST_ACTIVATION_KEY, TEST_PRODUCT_TOKEN).message
+          end
+          
+        end
+
       end
       
     end</diff>
      <filename>test/graceful_requestor_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a6588f3a261aa694f2bef51a4e331e5367c97275</id>
    </parent>
  </parents>
  <author>
    <name>Nathaniel Bibler</name>
    <email>git@nathanielbibler.com</email>
  </author>
  <url>http://github.com/nbibler/devpay/commit/a6b767a1e91d85995dc6ef0c730a4fa4dfeb2622</url>
  <id>a6b767a1e91d85995dc6ef0c730a4fa4dfeb2622</id>
  <committed-date>2008-05-30T07:27:29-07:00</committed-date>
  <authored-date>2008-05-30T07:27:29-07:00</authored-date>
  <message>Added ability to override error messages</message>
  <tree>ed89b5033d1e457acaec9afefcb212bc3d5cb958</tree>
  <committer>
    <name>Nathaniel Bibler</name>
    <email>git@nathanielbibler.com</email>
  </committer>
</commit>
