From efa56fb02de423b0a4c1b42dc0d4aacba3215ea6 Mon Sep 17 00:00:00 2001 From: Ernie Hershey Date: Sun, 22 Oct 2023 12:36:59 -0400 Subject: [PATCH] GODRIVER-2046 Return clearer error when truncating a float64 to float32 without the truncate tag --- 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 {