oscerd opened a new pull request, #25448:
URL: https://github.com/apache/camel/pull/25448
Three NPE/exception-hygiene fixes.
**1. A message with no body failed with a `NullPointerException`.** The
producer built its error out
of the body's class:
```java
ex.setException(new IllegalArgumentException("Cannot handle body type " +
entryObject.getClass()));
```
so the branch meant to report an unusable body threw while reporting it. It
now says
`Cannot handle body type null`.
**2. An unknown `CamelGoogleBigQueryJobId` gave a `NullPointerException`.**
In the SQL producer both
`bigquery.getJob(jobId)` and `job.waitFor()` return `null` for a job that no
longer exists (expired,
or never created), and neither was checked before use. Both now fail with a
message naming the job.
**3. Three raw `throw new Exception(...)`** in `GoogleBigQueryProducer` and
`GoogleBigQuerySQLProducer`
are now `RuntimeCamelException`, so routes get a Camel exception.
`onException(Exception.class)`
still matches, since `RuntimeCamelException` is one.
**Withdrawn from the issue description:** the audit also claimed the
`CamelGoogleBigQueryInsertId`
header is wrongly ignored for `List` bodies. Applying it there would be a
**bug**: BigQuery uses the
insert id for best-effort deduplication, so giving every row of a list the
same id makes it keep one
row and drop the rest. The existing behaviour is right — `useAsInsertId` (a
field name, so one id per
row) is the option for list payloads. This PR only adds a comment recording
that, and I commented on
the JIRA issue.
_Claude Code on behalf of oscerd_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]