I&#39;m running under mod_perl, and when a user aborts an upload I get an error in the log.<br><br><div style="margin-left: 40px;">[error] Caught exception in engine &quot;Apache2::RequestIO::read: (70014) <br>End of file found at /usr/local/share/perl/5.10.0/Catalyst/Engine/Apache.pm line 187&quot;<br>

<br></div>I don&#39;t see that it&#39;s possible, but is there any way to ignore some exceptions (similar to how execute() can ignore a detach)?   Not sure there&#39;s a good case for it, other than to simply ignore the above.  (I can modify my log monitoring to ignore those, for example).  But, there doesnt&#39;s seen to be any way to get out of that block without generating an error message.<br>

<br><pre>    eval {<br>        if ($class-&gt;debug) {<br>            my $secs = time - $START || 1;<br>            my $av = sprintf &#39;%.3f&#39;, $COUNT / $secs;<br>            my $time = localtime time;<br>            $class-&gt;log-&gt;info(&quot;*** Request $COUNT ($av/s) [$$] [$time] ***&quot;);<br>

        }<br><br>        my $c = $class-&gt;prepare(@arguments);<br>        $c-&gt;dispatch;<br>        $status = $c-&gt;finalize;<br>    };<br><br>    if ( my $error = $@ ) {<br>        chomp $error;<br>        $class-&gt;log-&gt;error(qq/Caught exception in engine &quot;$error&quot;/);<br>

    }<br></pre><br><br>Maybe I could override prepare() and return a different $c object with dummy dispatch and finalize methods, but I suspect another prepare() and that approach would break.<br><br>BTW -- I was looking at this along with the UploadProgress plugin.  It does this to catch aborted uploads.<br>

The plugin is a bit old, but doesn&#39;t seem like overriding croak is a good way to catch exceptions.  Is there any reason not to wrap prepare_body in an eval?   Yep, I just tried and under mod_perl2 this doesn&#39;t catch aborted uploads.<br>

<br><pre>    my $croaked;<br>    <br>    {<br>        no warnings &#39;redefine&#39;;<br>        local *Carp::croak = sub {<br>            $croaked = shift;<br>        };<br>        <br>        $c-&gt;NEXT::prepare_body(@_);<br>

    }<br>    <br>    if ( $croaked ) {<br>        if ( my $id = $c-&gt;req-&gt;query_parameters-&gt;{progress_id} ) {<br>            $c-&gt;log-&gt;info( &quot;UploadProgress: User aborted upload $id&quot; );<br>        <br>

            # Update progress to flag this so javascript will stop polling<br>            my $progress = $c-&gt;cache-&gt;get( &#39;upload_progress_&#39; . $id ) || {};<br>        <br>            $progress-&gt;{aborted} = 1;<br>

        <br>            $c-&gt;cache-&gt;set( &#39;upload_progress_&#39; . $id, $progress );<br>        }<br>        <br>        # rethrow the error<br>        Catalyst::Exception-&gt;throw( $croaked );<br>    }<br><font face="arial,helvetica,sans-serif"><br>

<br></font></pre><br><br><br><br><br>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org">moseley@hank.org</a><br><br>