mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-06 04:30:56 +08:00
Add error codes to a few errors (#657)
With elog(), you get XX000 "internal_error", which sounds scary. It's not self-evident what the right error codes for some of these errors are, but I tried to use my best judgment.
This commit is contained in:
committed by
GitHub
parent
85d877d540
commit
7117513532
@@ -1369,7 +1369,9 @@ SparsevecCheckValue(Pointer v)
|
||||
SparseVector *vec = (SparseVector *) v;
|
||||
|
||||
if (vec->nnz > HNSW_MAX_NNZ)
|
||||
elog(ERROR, "sparsevec cannot have more than %d non-zero elements for hnsw index", HNSW_MAX_NNZ);
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||
errmsg("sparsevec cannot have more than %d non-zero elements for hnsw index", HNSW_MAX_NNZ)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user