Skip to content

Fix/masked error statuses - #103

Open
JosteinGj wants to merge 2 commits into
mainfrom
fix/masked-error-statuses
Open

JosteinGj wants to merge 2 commits into
mainfrom
fix/masked-error-statuses

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

What this changes

How it was verified

Checklist

  • Pull requests this one depends on are named above and merged first, or there are none
  • Commits are signed off (git commit -s), per CONTRIBUTING.md
  • ./gradlew build passes
  • Behaviour visible outside this repo is reflected in the documentation, or does not need to be
    (see AGENTS.md for which of the two documentation sites it belongs in)

JosteinGj and others added 2 commits September 15, 2026 12:52
POST /timeseries/update answered every validation failure with a
NullPointerException. The per-field error branch built a ResponseError
and never put a BadRequestError inside it, so the first addFieldError
dereferenced null:

    ResponseError<BadRequestError> errors = new ResponseError<>();
    ts.getUpdate().getErrors().forEach(error ->
        errors.getError().addFieldError(...));   // getError() is null

Reachable from any rule in TimeseriesFields.validateUpdateFields — a
name under three characters is enough. The endpoint documents a 400 with
the offending fields; callers got a bare 500 and no indication of which
field was wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
…s 500

Two endpoints whose catch-all turned a verdict into a server fault. A 500
tells the caller the server broke and the request is worth retrying; both
of these will fail identically until the caller changes something.

POST /policies/delete reaches the shared resource-delete pipeline through
PolicyService.deletePolicies, so it is subject to the same stranded-node
guard as every other delete and asserts write on the policy's data set.
It was the one delete endpoint with no ResourceDeleteException catch, so
a refusal — which carries the offending resources — came back as a
bodyless 500 naming nothing, and a denial came back the same way.

POST /subscriptions/create asserts read on every timeseries the body
names (SubscriptionService:103), so subscribing to a series in an
unreadable data set is a denial. The broad RuntimeException catch
reported it as a server fault.

Both surface through handlers that already exist, in the shape those
handlers already produce, so no response shape changes. The other
fourteen catch-alls call services that narrow by readable data set
rather than asserting, so they never raise AccessDeniedException and are
left alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@JosteinGj
JosteinGj requested a review from olavgg as a code owner September 15, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants