summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-03-09 19:14:02 +0100
committerYorhel <git@yorhel.nl>2010-03-09 19:14:02 +0100
commitb40d4a568aaa5b2a1885bb476702f9c4e094cffd (patch)
tree0ec979f0c32aa3087334256a3d22985523fdda0b /lib
parent484c3c43c63096a8fb6c3fca09e2e6a0388b662c (diff)
Multi::API: Properly format returned error message on incorrect UTF8
Diffstat (limited to 'lib')
-rw-r--r--lib/POE/Filter/VNDBAPI.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/POE/Filter/VNDBAPI.pm b/lib/POE/Filter/VNDBAPI.pm
index 6608893b..ceb9ae2d 100644
--- a/lib/POE/Filter/VNDBAPI.pm
+++ b/lib/POE/Filter/VNDBAPI.pm
@@ -103,7 +103,11 @@ sub get_one {
# $str now contains our request/response encoded in UTF8, time to decode
$str = eval { decode_utf8($str, Encode::FB_CROAK); };
- return _err "Encoding error: $@" if !defined $str;
+ if(!defined $str) {
+ my $err = $@;
+ $err =~ s/,? at .+ line [0-9]+[\.\r\n ]*$//;
+ return _err "Encoding error: $err" if !defined $str;
+ }
# get command
return _err "Invalid command" if !($str =~ s/^$WS*([a-z]+)$WS*//);