title: Throwing exception in Python and reading the message in jQuery
body: <p>How can I throw an exception on my server and have the exception's message be read in JavaScript (I'm using AJAX with jQuery).  My server environment is Google App Engine (Python).</p>
  
  <p>Here's my server code:</p>
  
  <pre><code>def post(self):
      answer_text = util.escapeText(self.request.get("answer"))
      # Validation
      if ( len(str(answer_text)) &lt; 3):
          raise Exception("Answer text must be at least 2 characters long.")
          return
  </code></pre>
  
  <p>And here's the AJAX request:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "/store_answer.html",
      data: "question_id=" + question_id +"&amp;answer="+answer,
      success: function(responseText){
      handleSuccessfulAnswer(question_id);
      },
      error: function(responseText){
      // TODO: How to get the exception message here???
      alert("???????????");
      },
      complete: function(data) {
      submitCompleted(submitName, "Submit");
      }
  });
  </code></pre>
  
  <p>Thanks!</p>