From 4f44ebf5f1da8829e72bf838b9611f241a6a8154 Mon Sep 17 00:00:00 2001 From: Ernie Hershey Date: Wed, 1 Nov 2023 16:40:42 -0400 Subject: [PATCH] GODRIVER-2046 Return clearer error when truncating a float64 to float32 without the truncate tag (#1448) --- bson/bsoncodec/default_value_decoders.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bson/bsoncodec/default_value_decoders.go b/bson/bsoncodec/default_value_decoders.go index e479c3585b..2ce119731b 100644 --- a/bson/bsoncodec/default_value_decoders.go +++ b/bson/bsoncodec/default_value_decoders.go @@ -24,7 +24,7 @@ import ( var ( defaultValueDecoders DefaultValueDecoders - errCannotTruncate = errors.New("float64 can only be truncated to an integer type when truncation is enabled") + errCannotTruncate = errors.New("float64 can only be truncated to a lower precision type when truncation is enabled") ) type decodeBinaryError struct {