paul-rogers opened a new pull request #12220: URL: https://github.com/apache/druid/pull/12220
### Description The Overlord REST APIs return JSON for the successful cases, and use a filter to handle errors. Unfortunately, the error handler returns plain text, which breaks a client that expects to receive the JSON error format added in recent PRs. This PR converts the errors to JSON following the emerging standard. In addition. the recently-added standard error handling has a couple of holes. If the code provides just an error message, then the error code (which is what is primarily shown) is blank. If just an error code, then the error message is blank. This PR says that if only one is provided, use it for both places. Jackson provides ways to omit fields which are at a null value. This PR uses that feature to not include fields which are null, simplifying the returned error JSON. This error handling was encountered in the process of creating an Overlord service. In doing that, it turned out that it was necessary to create a `TaskStatus`, but the constructor was private. This PR makes the constructor public at no loss of functionality. The PR also contains a number of typo cleanups encountered during the work. <hr> This PR has: - [X] been self-reviewed. - [X] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [X] been tested in a test Druid cluster as part of an overall project. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
