<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 16 Nov 2007, at 14:52, Michael D. Ivey wrote:</div><blockquote type="cite">I had never thought of pushing it all into the model. &nbsp;It may be a &nbsp;<br>"violation of MVC" to raise controller exceptions from inside models, &nbsp;<br>but is that a bad thing? &nbsp;Raising "Moved" with the new name is &nbsp;<br>excellent.</blockquote><div><br class="webkit-block-placeholder"></div>I've been playing with a fork of merb for one production app, and for me ControllerExceptions are more like ApplicationExceptions not specific to controller-land</div><div><br class="webkit-block-placeholder"></div><div><blockquote type="cite">Have you used a pattern like this in production yet?</blockquote><div><br class="webkit-block-placeholder"></div>On a few rails apps, I've used something similar, although without merb's exception controllers its a bit messy.</div><div><br class="webkit-block-placeholder"></div><div>try:&nbsp;</div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><a href="http://www.africacollection.co.uk/pages/1-holidays-to-southern-africa-the-indian-ocean">http://www.africacollection.co.uk/pages/1-holidays-to-southern-africa-the-indian-ocean</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">then</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><a href="http://www.africacollection.co.uk/pages/1-holidays-to-southern-africa-blah-blah-blah">http://www.africacollection.co.uk/pages/1-holidays-to-southern-africa-blah-blah-blah</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div></div></div><div><blockquote type="cite">BTW: &nbsp;Merb already defines MovedPermanently and MovedTemporarily, but &nbsp;<br>they don't take the arg for the new URL. &nbsp;We should add that:<br> &nbsp;&nbsp;&nbsp;raise MovedPermanently.new(new_url)</blockquote><br></div><div>A built in handler for the Moved__ error classes would be nice too.</div><div><br class="webkit-block-placeholder"></div><div>raise MovedTemporaily.new(url)</div><div><br class="webkit-block-placeholder"></div><div>would be roughly equal to</div><div><br class="webkit-block-placeholder"></div><div>redirect(url) and throw(:halt)</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div></body></html>