From 9b1687d46c34f06770fb0ee630060e267eb36830 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 8 Jun 2024 07:24:50 -0700 Subject: [PATCH] applets/wiktionary.pl: add error-checking --- applets/wiktionary.pl | 7 ++++++- lib/PBot/VERSION.pm | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/applets/wiktionary.pl b/applets/wiktionary.pl index a66964d5..69992a24 100755 --- a/applets/wiktionary.pl +++ b/applets/wiktionary.pl @@ -91,7 +91,12 @@ my $entries = $cache->get($cache_id); if (not defined $entries) { my $json = `python3 wiktionary.py \Q$term\E \Q$lang\E`; - $entries = decode_json $json; + $entries = eval { decode_json $json }; + if ($@) { + print "$json\n"; + print "$@\n"; + die; + } $cache->set($cache_id, $entries); } diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index d93ee893..06e7a313 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,8 +25,8 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4757, - BUILD_DATE => "2024-06-03", + BUILD_REVISION => 4758, + BUILD_DATE => "2024-06-08", }; sub initialize {}