diff --git a/src/utils.ts b/src/utils.ts index 92df9755..135a8366 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -72,11 +72,12 @@ export function toFailure( const { path, branch } = context const { type } = struct + const finalValue = typeof value === 'object' ? JSON.stringify(value) : value const { refinement, message = `Expected a value of type \`${type}\`${ refinement ? ` with refinement \`${refinement}\`` : '' - }, but received: \`${print(value)}\``, + }, but received: \`${print(finalValue)}\``, } = result return {