Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 1d51fe9

Browse files
committed
HHVM-173: Rephrase unsupported/corrupt BSON messages to be the same as PHPC-554
1 parent c6beeab commit 1d51fe9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bson.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ bool BsonToVariantConverter::convert(Variant *v)
799799

800800
if (!bson_iter_init(&iter, b)) {
801801
bson_reader_destroy(m_reader);
802+
throw MongoDriver::Utils::throwUnexpectedValueException("Could not initialize BSON iterator");
802803
return false;
803804
}
804805

@@ -808,7 +809,7 @@ bool BsonToVariantConverter::convert(Variant *v)
808809
if (bson_iter_visit_all(&iter, &hippo_bson_visitors, &m_state) || iter.err_off) {
809810
bson_reader_destroy(m_reader);
810811

811-
throw MongoDriver::Utils::throwUnexpectedValueException("Could not convert BSON document to a PHP variable");
812+
throw MongoDriver::Utils::throwUnexpectedValueException("Detected corrupt BSON data.");
812813
}
813814

814815
/* Set "root" to false */

0 commit comments

Comments
 (0)