X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=e6e8657300a5e97fb1a36ed706477dd59a1c92fa;hb=5b4973aa317bc6bcb27f2c3d37c1309e508b3ce1;hp=1306b94f2dee59251d1a7e20dc66eadae1854ce5;hpb=efc1a69b1e03a40bc721aa745846d45f855b9511;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 1306b94..e6e8657 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -123,7 +123,7 @@ sub _build_body_data { # Not sure if these returns should not be exceptions... my $content_type = $self->content_type || return; - return unless ($self->method eq 'POST' || $self->method eq 'PUT'); + return unless ($self->method eq 'POST' || $self->method eq 'PUT' || $self->method eq 'PATCH'); my ($match) = grep { $content_type =~/$_/i } keys(%{$self->data_handlers}); @@ -132,8 +132,11 @@ sub _build_body_data { my $fh = $self->body; local $_ = $fh; return $self->data_handlers->{$match}->($fh, $self); - } else { - Catalyst::Exception->throw("$content_type is does not have an available data handler"); + } else { + Catalyst::Exception->throw( + sprintf '%s does not have an available data handler. Valid data_handlers are %s.', + $content_type, join ', ', sort keys %{$self->data_handlers} + ); } }