Merge branch 'warn-on-uri-for' of https://github.com/melmothx/catalyst-runtime into...
John Napiorkowski [Thu, 29 Oct 2015 14:58:03 +0000 (09:58 -0500)]
Changes
lib/Catalyst/Request.pm

diff --git a/Changes b/Changes
index 4d86d01..d785ab8 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+5.90102 - 2015-10-29
+  - Better warnings when there's an error reading the psgi.input
+  -
 5.90101 - 2015-09-04
   - Fixed a regression introduced in the last release which caused test
     case failure when using a version of Perl 5.14 or older.
index 3bcc6c2..1306b94 100644 (file)
@@ -293,7 +293,10 @@ sub prepare_body {
     # Check for definedness as you could read '0'
     while ( defined ( my $chunk = $self->read() ) ) {
         $self->prepare_body_chunk($chunk);
-        $stream_buffer->print($chunk) if $stream_buffer;
+        next unless $stream_buffer;
+
+        $stream_buffer->print($chunk)
+            || die sprintf "Failed to write %d bytes to psgi.input file: $!", length( $chunk );
     }
 
     # Ok, we read the body.  Lets play nice for any PSGI app down the pipe