-
Notifications
You must be signed in to change notification settings - Fork 944
Do not use ERRCODE_INTERNAL_ERROR for user errors #8188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@antekresic, @erimatnor: please review this pull request.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8188 +/- ##
==========================================
+ Coverage 82.32% 82.37% +0.05%
==========================================
Files 256 256
Lines 47931 47903 -28
Branches 12077 12073 -4
==========================================
+ Hits 39458 39462 +4
- Misses 3637 3657 +20
+ Partials 4836 4784 -52 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/chunk_adaptive.c
Outdated
|
||
elog(DEBUG1, "[adaptive] chunk_target_size_bytes=" UINT64_FORMAT, chunk_target_size_bytes); | ||
|
||
hypertable_id = ts_dimension_get_hypertable_id(dimension_id); | ||
|
||
if (hypertable_id <= 0) | ||
elog(ERROR, "could not find a matching hypertable for dimension %u", dimension_id); | ||
ereport(ERROR, | ||
(errcode(ERRCODE_NO_DATA_FOUND), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a PL/pgSQL error, so you should not use this here. The closest match seems to be ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
, but ERRCODE_UNDEFINED_OBJECT
is also used in similar situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERRCODE_UNDEFINED_OBJECT
seems more appropriated for this case
@Poroma-Banerjee there many other |
e7d6e99
to
b77baf6
Compare
This code is reserved for internal program errors, i.e. bugs. This commit fixes only some of these existing incorrect codes, we have more.
"cannot compress tables with reserved column prefix '%s'", | ||
COMPRESSION_COLUMN_METADATA_PREFIX); | ||
ereport(ERROR, | ||
(errcode(ERRCODE_RESERVED_NAME), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be ERRCODE_INVALID_NAME
?
This code is reserved for internal program errors, i.e. bugs. This commit fixes only some of these existing incorrect codes, we have more.
Or else, the CI pipeline will complain about detecting internal errors from regression tests.
Disable-check: force-changelog-file