mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-05 19:49:32 +01:00
applets/wiktionary.pl: add error-checking
This commit is contained in:
parent
04209e4b7e
commit
9b1687d46c
7
applets/wiktionary.pl
vendored
7
applets/wiktionary.pl
vendored
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 {}
|
||||
|
Loading…
Reference in New Issue
Block a user