From 6ed544fb866eb0ea2aa154e7fdd38b45a0f63cf1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 1 Nov 2023 19:32:20 -0500 Subject: [PATCH] GODRIVER-2046 [master] Return clearer error when truncating a float64 to float32 without the truncate tag (#1449) Co-authored-by: Ernie Hershey --- 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 {