<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Tue May 21 13:19:25 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.couchbase.com/issues/si/jira.issueviews:issue-xml/RCBC-95/RCBC-95.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[RCBC-95] Server&apos;s helpful error about map.js errors gets replaced by a generic http 400 happened while uploading design document</title>
                <link>http://www.couchbase.com/issues/browse/RCBC-95</link>
                <project id="10048" key="RCBC">Couchbase Ruby client library</project>
                        <description>Repro:&lt;br/&gt;
&lt;br/&gt;
Create a new model, use the genrator to create a view&lt;br/&gt;
add the view line to the model&lt;br/&gt;
start the app (rails console)&lt;br/&gt;
&lt;br/&gt;
The default map.js with all the comments in and examples will cause the error already.&lt;br/&gt;
&lt;br/&gt;
/Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/couchbase-1.2.0.z.beta4/lib/couchbase/bucket.rb:165:in `continue&amp;#39;: failed to execute HTTP request (key=&amp;quot;_design/clocking&amp;quot;, status=&amp;quot;400&amp;quot; (Bad Request), error=0x00) (Couchbase::Error::HTTP)&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/couchbase-1.2.0.z.beta4/lib/couchbase/bucket.rb:165:in `save_design_doc&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/couchbase-model-0.5.0/lib/couchbase/model.rb:260:in `ensure_design_document!&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/couchbase-model-0.5.0/lib/couchbase/railtie.rb:120:in `block (3 levels) in &amp;lt;class:Railtie&amp;gt;&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/couchbase-model-0.5.0/lib/couchbase/railtie.rb:119:in `each&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/couchbase-model-0.5.0/lib/couchbase/railtie.rb:119:in `block (2 levels) in &amp;lt;class:Railtie&amp;gt;&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:418:in `_run__3328634455356380055__prepare__3132553472985099836__callbacks&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `__run_callback&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/actionpack-3.2.9/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/actionpack-3.2.9/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/application/finisher.rb:47:in `block in &amp;lt;module:Finisher&amp;gt;&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `block in run_initializers&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing&amp;#39;&lt;br/&gt;
	from /Users/piotr/Work/git/ph_time/config/environment.rb:5:in `&amp;lt;top (required)&amp;gt;&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/application.rb:103:in `require&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/application.rb:103:in `require_environment!&amp;#39;&lt;br/&gt;
	from /Users/piotr/.rvm/gems/ruby-1.9.3-p327@time/gems/railties-3.2.9/lib/rails/commands.rb:40:in `&amp;lt;top (required)&amp;gt;&amp;#39;&lt;br/&gt;
	from script/rails:6:in `require&amp;#39;&lt;br/&gt;
	from script/rails:6:in `&amp;lt;main&amp;gt;&amp;#39;&lt;br/&gt;
&lt;br/&gt;
Now after a bit of tinkering .. I just added an else to the if block_given? in there .. to reveal the error .. &lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if block_given?&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if res.success? &amp;amp;&amp;amp; val[&amp;#39;error&amp;#39;]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res.error = Error::View.new(&amp;quot;save_design_doc&amp;quot;, val[&amp;#39;error&amp;#39;])&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;yield(res)&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;unless res.success?&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if val[&amp;#39;error&amp;#39;] &amp;amp;&amp;amp; val[&amp;#39;reason&amp;#39;]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;raise Couchbase::Error::View.new(val[&amp;#39;error&amp;#39;], val[&amp;#39;reason&amp;#39;])&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br/&gt;
&lt;br/&gt;
And that returned a much more civil error:&lt;br/&gt;
&lt;br/&gt;
SERVER: invalid_design_document: Syntax error in the map function of the view `by_date&amp;#39;: SyntaxError: Unexpected end of input (Couchbase::Error::View)&lt;br/&gt;
</description>
                <environment>Mountain Lion</environment>
            <key id="20924">RCBC-95</key>
            <summary>Server&apos;s helpful error about map.js errors gets replaced by a generic http 400 happened while uploading design document</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10011">Public</security>
                        <assignee username="avsej">Sergey Avseyev</assignee>
                                <reporter username="piotrb">Piotr Banasik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Nov 2012 17:15:29 -0600</created>
                <updated>Fri, 8 Feb 2013 18:15:14 -0600</updated>
                    <resolved>Thu, 29 Nov 2012 05:06:43 -0600</resolved>
                            <version>1.2.0.z.beta4</version>
                                <fixVersion>1.2.0</fixVersion>
                                <component>library</component>
                                <votes>0</votes>
                        <watches>0</watches>
                                                    <comments>
                    <comment id="44699" author="piotrb" created="Fri, 23 Nov 2012 17:17:04 -0600"  >Not sure if you want to keep that error code in there .. or perhaps tweak how the res.error stuff works in the block given section and call this better in the client lib perhaps? Not sure .. maybe tweak it on both ends really .. </comment>
                    <comment id="44993" author="avsej" created="Thu, 29 Nov 2012 05:06:43 -0600"  >Fix &lt;a href=&quot;http://review.couchbase.org/22894&quot;&gt;http://review.couchbase.org/22894&lt;/a&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                                                                                                                                                    <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>8716</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10181" key="com.atlassian.jira.ext.charting:timeinstatus">
                <customfieldname>Time In Status</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                </customfields>
    </item>
</channel>
</rss>