File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class SparseVector {
2525 // / Creates a sparse vector from a span.
2626 explicit SparseVector (std::span<const float > value) {
2727 if (value.size () > std::numeric_limits<int >::max ()) {
28- throw std::invalid_argument{" too many dimensions" };
28+ throw std::invalid_argument{" sparsevec cannot have more than max int dimensions" };
2929 }
3030 dimensions_ = static_cast <int >(value.size ());
3131
@@ -42,7 +42,7 @@ class SparseVector {
4242 // / Creates a sparse vector from a map of non-zero elements.
4343 SparseVector (const std::unordered_map<int , float >& map, int dimensions) {
4444 if (dimensions < 0 ) {
45- throw std::invalid_argument{" sparsevec dimensions cannot be negative" };
45+ throw std::invalid_argument{" sparsevec cannot have negative dimensions " };
4646 }
4747 dimensions_ = dimensions;
4848
Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ void test_sparsevec_from_string() {
258258
259259 assert_exception<pqxx::conversion_error>([] {
260260 auto _ = pqxx::from_string<pgvector::SparseVector>(" {}/-1" );
261- }, " sparsevec dimensions cannot be negative" );
261+ }, " sparsevec cannot have negative dimensions " );
262262
263263 assert_exception<pqxx::conversion_error>([] {
264264 auto _ = pqxx::from_string<pgvector::SparseVector>(" {:}/1" );
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ static void test_constructor_map() {
2828
2929 assert_exception<std::invalid_argument>([&]{
3030 SparseVector (map, -1 );
31- }, " sparsevec dimensions cannot be negative" );
31+ }, " sparsevec cannot have negative dimensions " );
3232
3333 assert_exception<std::invalid_argument>([&]{
3434 SparseVector (map, 4 );
You can’t perform that action at this time.
0 commit comments