3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-16 00:49:35 +01:00

applets/wiktionary.pl: add error-checking

This commit is contained in:
Pragmatic Software 2024-06-08 07:24:50 -07:00
parent 04209e4b7e
commit 9b1687d46c
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 8 additions and 3 deletions

View File

@ -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);
}

View File

@ -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 {}