I found an interesting page today that I was trying to script against. The server returns a 404 with content and the page just works normally in firefox despite the 404. Mechanize raises an exception on it though. I''m working on a test case now.
> I found an interesting page today that I was trying to script > against. The server returns a 404 with content and the page just > works normally in firefox despite the 404. Mechanize raises an > exception on it though. > > I''m working on a test case now.After looking at the code, I think a behavior decision is necesary before a test case. I can understand the reasoning for raising an exception, but it would be really valuable if the page were still available from the exception. I think putting the page into the ResponseCodeError would be a decent approach. Thoughts Aaron? Should I make a patch to the svn trunk? -Mat
On Tue, Sep 26, 2006 at 01:51:54PM -0400, Mat Schaffer wrote:> After looking at the code, I think a behavior decision is necesary > before a test case. I can understand the reasoning for raising an > exception, but it would be really valuable if the page were still > available from the exception. I think putting the page into the > ResponseCodeError would be a decent approach. Thoughts Aaron? > Should I make a patch to the svn trunk?You are correct. We should have access to the page after a 404 is returned. I also agree that putting the page on the exception is a fine idea. If you''d like to patch it, do it against the release branch: svn://rubyforge.org/var/svn/mechanize/branches/RB-0.6.0 Otherwise I will fix this error. Thank you! -- Aaron Patterson http://tenderlovemaking.com/
On Sep 26, 2006, at 5:09 PM, Aaron Patterson wrote:> On Tue, Sep 26, 2006 at 01:51:54PM -0400, Mat Schaffer wrote: >> After looking at the code, I think a behavior decision is necesary >> before a test case. I can understand the reasoning for raising an >> exception, but it would be really valuable if the page were still >> available from the exception. I think putting the page into the >> ResponseCodeError would be a decent approach. Thoughts Aaron? >> Should I make a patch to the svn trunk? > > You are correct. We should have access to the page after a 404 is > returned. I also agree that putting the page on the exception is a > fine > idea. > > If you''d like to patch it, do it against the release branch: > svn://rubyforge.org/var/svn/mechanize/branches/RB-0.6.0 > > Otherwise I will fix this error. Thank you!I might have some time tomorrow and I''d like to help out. I just updated to 0.6.1 via gem though, so wouldn''t it be better to patch against that? Or are the odds considered unstable?
On Tue, Sep 26, 2006 at 11:43:35PM -0400, Mat Schaffer wrote:> I might have some time tomorrow and I''d like to help out. I just > updated to 0.6.1 via gem though, so wouldn''t it be better to patch > against that? Or are the odds considered unstable?I don''t really do the whole even odd thing. I consider what I release to be stable. The code in that release branch is the same as what is in 0.6.1. I just keep patching and tagging the release branch for subsiquent bugfix releases. The trunk I save for major releases. I should be able to fix this problem before the end of the weekend if you don''t get around to it! :-) --Aaron -- Aaron Patterson http://tenderlovemaking.com/
On Tue, Sep 26, 2006 at 11:43:35PM -0400, Mat Schaffer wrote:> On Sep 26, 2006, at 5:09 PM, Aaron Patterson wrote: > > On Tue, Sep 26, 2006 at 01:51:54PM -0400, Mat Schaffer wrote: > >> After looking at the code, I think a behavior decision is necesary > >> before a test case. I can understand the reasoning for raising an > >> exception, but it would be really valuable if the page were still > >> available from the exception. I think putting the page into the > >> ResponseCodeError would be a decent approach. Thoughts Aaron? > >> Should I make a patch to the svn trunk? > > > > You are correct. We should have access to the page after a 404 is > > returned. I also agree that putting the page on the exception is a > > fine > > idea. > > > > If you''d like to patch it, do it against the release branch: > > svn://rubyforge.org/var/svn/mechanize/branches/RB-0.6.0 > > > > Otherwise I will fix this error. Thank you! > > I might have some time tomorrow and I''d like to help out. I just > updated to 0.6.1 via gem though, so wouldn''t it be better to patch > against that? Or are the odds considered unstable?I took care of the problem, it was a pretty simple fix. If you need it right away, just check out from the release branch and run "rake package" to build the gem. Otherwise this will be out with 0.6.2. --Aaron -- Aaron Patterson http://tenderlovemaking.com/
On Sep 27, 2006, at 1:50 PM, Aaron Patterson wrote:> On Tue, Sep 26, 2006 at 11:43:35PM -0400, Mat Schaffer wrote: >> On Sep 26, 2006, at 5:09 PM, Aaron Patterson wrote: >>> On Tue, Sep 26, 2006 at 01:51:54PM -0400, Mat Schaffer wrote: >>>> After looking at the code, I think a behavior decision is necesary >>>> before a test case. I can understand the reasoning for raising an >>>> exception, but it would be really valuable if the page were still >>>> available from the exception. I think putting the page into the >>>> ResponseCodeError would be a decent approach. Thoughts Aaron? >>>> Should I make a patch to the svn trunk? >>> >>> You are correct. We should have access to the page after a 404 is >>> returned. I also agree that putting the page on the exception is a >>> fine >>> idea. >>> >>> If you''d like to patch it, do it against the release branch: >>> svn://rubyforge.org/var/svn/mechanize/branches/RB-0.6.0 >>> >>> Otherwise I will fix this error. Thank you! >> >> I might have some time tomorrow and I''d like to help out. I just >> updated to 0.6.1 via gem though, so wouldn''t it be better to patch >> against that? Or are the odds considered unstable? > > I took care of the problem, it was a pretty simple fix. If you > need it > right away, just check out from the release branch and run "rake > package" to build the gem. Otherwise this will be out with 0.6.2.Hey thanks. Sorry for being too slow on the draw, but I was bogged down in other projects. Maybe next time. -Mat
On Wed, Sep 27, 2006 at 03:40:26PM -0400, Mat Schaffer wrote: [snip]> Hey thanks. Sorry for being too slow on the draw, but I was bogged > down in other projects. Maybe next time.No problem! I was just taking a look at it, and I figured I may as well fix it while I''m staring at the code! -- Aaron Patterson http://tenderlovemaking.com/