mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-19 11:16:34 +00:00
debug: Print more information about failing validations
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
f9626a3ee4
commit
987de0e097
@ -4,6 +4,7 @@ import { Transaction } from 'knex';
|
||||
import * as _ from 'lodash';
|
||||
import { generateUniqueKey } from 'resin-register-device';
|
||||
import StrictEventEmitter from 'strict-event-emitter-types';
|
||||
import { inspect } from 'util';
|
||||
|
||||
import { Either } from 'fp-ts/lib/Either';
|
||||
import * as t from 'io-ts';
|
||||
@ -279,9 +280,10 @@ export class Config extends (EventEmitter as {
|
||||
const decoded = type.decode(value);
|
||||
if (decoded.isLeft()) {
|
||||
throw new TypeError(
|
||||
`Cannot set value for ${key}, as value failed validation: ${
|
||||
decoded.value
|
||||
}`,
|
||||
`Cannot set value for ${key}, as value failed validation: ${inspect(
|
||||
value,
|
||||
{ depth: Infinity },
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
return decoded.value;
|
||||
|
Loading…
Reference in New Issue
Block a user