Skip to content

Commit adb6fad

Browse files
committed
RUBY-1174 Add details to invalid max staleness error message
1 parent 1ee8e67 commit adb6fad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/mongo/error/invalid_server_preference.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ class InvalidServerPreference < Error
3333
# Error message for when the max staleness is not at least twice the heartbeat frequency.
3434
#
3535
# @since 2.4.0
36-
INVALID_MAX_STALENESS = "max_staleness value is too small.".freeze
36+
INVALID_MAX_STALENESS = "`max_staleness` value is too small. It must be at least " +
37+
"`ServerSelector::SMALLEST_MAX_STALENESS_SECONDS` and (the cluster's heartbeat_frequency " +
38+
"setting + `Cluster::IDLE_WRITE_PERIOD_SECONDS`).".freeze
3739

3840
# Error message when max staleness cannot be used because one or more servers has version < 3.4.
3941
#

0 commit comments

Comments
 (0)