You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "plusplusjiajia (via GitHub)" <gi...@apache.org> on 2026/08/28 17:13:42 UTC
[PR] [api] Stop reading a server error message as a format string [paimon]
plusplusjiajia opened a new pull request, #9454:
URL: https://github.com/apache/paimon/pull/9454
### Purpose
A server's error message is data, but DefaultErrorHandler hands it to java.util.Formatter as syntax. When the message contains a %, translating the response throws MissingFormatArgumentException instead of the REST exception the caller waits for, so catch (BadRequestException) never runs and the server's message is lost.
message: quota 80% exceeded
before : java.util.MissingFormatArgumentException: Format specifier '% e'
after : BadRequestException: quota 80% exceeded
Two things combine to cause it:
- Four of the eight exception classes format twice. NotAuthorizedException, ServiceFailureException, NotImplementedException and ServiceUnavailableException call super(String.format(message, args)), and RESTException formats again — the inner call consumes the arguments, leaving the outer one a substituted string and none. The other four already pass super(message, args).
- Two call sites pass the message as the format. case 400 wraps it in String.format("%s", message), which reads like a guard but returns the message unchanged for the constructor to format; case 501 passes it straight through. The other seven branches already pass "%s" with the message as an argument.
RESTCatalog.listSystemTablesPaged has the same shape and also drops the IllegalArgumentException explaining the rejection. RESTException has a cause-carrying constructor but no subclass exposes one, so this adds it to BadRequestException — the only subclass with a caller that needs it today.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [api] Stop reading a server error message as a format string [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #9454:
URL: https://github.com/apache/paimon/pull/9454#issuecomment-5462530419
+1
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [api] Stop reading a server error message as a format string [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #9454:
URL: https://github.com/apache/paimon/pull/9454
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org