# Try-Catch AWDWR P3.0, Sect9.2,Mid pg 121

**URL:** <https://www.ruby-forum.com/t/try-catch-awdwr-p3-0-sect9-2-mid-pg-121/128298>\
**Category:** Rails\
**Created:** [February 6, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/try-catch-awdwr-p3-0-sect9-2-mid-pg-121/128298 "2008-02-06T15:17:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![louarnold](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6a8cbe/32.png) [@louarnold](https://www.ruby-forum.com/u/louarnold)\
**Post date:** [February 6, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/try-catch-awdwr-p3-0-sect9-2-mid-pg-121/128298/1 "2008-02-06T15:17:42Z")

</div>

On page 118, file store\_controller.rb, the “redirect\_to\_index” is added.  
At mid page 120, that line is removed. When the browser is first sent to  
the “:3000/store”, the page displays properly. But when the Add to Cart  
button is clicked, the browser displays the text of a try-catch block  
(see below). There is no error message - the browser clearly sees text  
to be displayed. If I re-introduce the redirect line again, all “seems”  
to work well.  
Q1: What causes the try-catch block text display? Its obviously  
generated code; how would I find out what generated it?  
Q2: How do I know when is the Ajax part is really working? What key  
phrases should be displayed in the log file? (I’ve looked in the log  
file, but I can’t tell.)

try {  
Element.update(“cart”, "\074div class=“cart-title”\076Your  
Cart\074/div\076\n\074table\076\n\t\n\t\074tr\076  
id=“current\_item”\076\n\n\t\074td\0763×\074/td\076\n\t\074td\076Pragmatic  
Project Automation\074/td\076\n (see the attachment for the rest)

---

<div class="post-metadata">

**Author:** ![louarnold](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6a8cbe/32.png) [@louarnold](https://www.ruby-forum.com/u/louarnold)\
**Post date:** [February 6, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/try-catch-awdwr-p3-0-sect9-2-mid-pg-121/128298/2 "2008-02-06T23:43:49Z")

</div>

#1: the try and catch parts are ruby javascript or RJS. Check to see  
what  
code it’s using to request the page.

#2: There is no way to tell.
