Skip to content

Commit 8119a34

Browse files
committed
fix: only normalize numeric API error codes
1 parent 987ffa7 commit 8119a34

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/io/facturapi/http/FacturapiHttpClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ private FacturapiException buildApiException(String bodyText, Response response)
245245
}
246246

247247
JsonNode codeNode = firstDefined(root, "code");
248-
if (codeNode != null && !codeNode.isNull()) {
249-
errorCode = codeNode.isValueNode() ? codeNode.asText() : codeNode.toString();
248+
if (codeNode != null && (codeNode.isTextual() || codeNode.isNumber())) {
249+
errorCode = codeNode.asText();
250250
}
251251

252252
JsonNode pathNode = firstDefined(root, "path");

0 commit comments

Comments
 (0)