mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
resolvectl: output nice error message if we can't JSONify RR
Some RR types we don't have a mapping to JSON for. Handle this reasonably.
This commit is contained in:
committed by
Luca Boccassi
parent
217f63c9b8
commit
fbcfa943cd
@@ -454,6 +454,9 @@ static int output_rr_packet(const void *d, size_t l, int ifindex) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to convert RR to JSON: %m");
|
||||
|
||||
if (!j)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "JSON formatting for records of type %s (%u) not available.", dns_type_to_string(rr->key->type), rr->key->type);
|
||||
|
||||
r = json_variant_dump(j, arg_json_format_flags, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user