Skip to content

MLE-32022 Avoid null pointer exception when FailedRequest is null - #1972

Open
rjdew-progress wants to merge 1 commit into
developfrom
MLE-32022
Open

MLE-32022 Avoid null pointer exception when FailedRequest is null#1972
rjdew-progress wants to merge 1 commit into
developfrom
MLE-32022

Conversation

@rjdew-progress

@rjdew-progress rjdew-progress commented Aug 21, 2026

Copy link
Copy Markdown

Addresses GitHub issue #1969

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a null-pointer exception when FailedRequest is absent by using an unknown server-status value.

Changes:

  • Adds STATUS_UNKNOWN (-1).
  • Handles missing failed-request status codes safely.
  • Adds regression coverage for null FailedRequest handling.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
marklogic-client-api/src/test/java/com/marklogic/client/test/FailedRequestTest.java Adds null-request regression test.
marklogic-client-api/src/main/java/com/marklogic/client/MarkLogicServerException.java Prevents null status-code unboxing.
marklogic-client-api/src/main/java/com/marklogic/client/impl/RESTServices.java Defines the unknown status constant.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rjrudin rjrudin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An interesting design choice as to what to return! I could see an argument for returning 500 - i.e. "Well we know the server complained about something, but we have no idea why for internal reasons, so here you go, have a 500" - but -1 seems reasonable as well as a way of communicating that we don't know what happened.

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.

5 participants