Created
September 25, 2010 15:06
-
-
Save marcusramberg/596918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Changes b/Changes | |
index b3f1f2b..2a37e6c 100644 | |
--- a/Changes | |
+++ b/Changes | |
@@ -29,6 +29,7 @@ This file documents the revision history for Perl extension Mojolicious. | |
(vti) | |
- Added b function to all Mojo::Template templates. | |
- Added selector support to the dom method of Mojo::Message. (marcus) | |
+ - Make failed ojo requests warn (marcus) | |
- Simplified transaction pausing by replacing it with an automatism. | |
- Improved RFC3986 compliance of Mojo::Path. (janus) | |
- Improved Mojo::Server::PSGI to preload applications. | |
diff --git a/lib/ojo.pm b/lib/ojo.pm | |
index 2812998..bea99cb 100644 | |
--- a/lib/ojo.pm | |
+++ b/lib/ojo.pm | |
@@ -47,6 +47,10 @@ sub _request { | |
? $client->build_form_tx(@_) | |
: $client->build_tx($method, @_); | |
$client->process($tx, sub { $tx = $_[1] }); | |
+ # Error | |
+ my ($message, $code) = $tx->error; | |
+ print qq/Couldn't open URL "$_[0]". ($message)\n/ if $message && !$code; | |
+ | |
return $tx->res; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment