more http logging to subdirectory of temp

This commit is contained in:
Grahame Grieve 2023-04-27 20:09:23 +10:00
parent 949c57acbf
commit 07a2e63941
1 changed files with 2 additions and 1 deletions

View File

@ -72,10 +72,11 @@ public class SimpleHTTPClient {
public void checkThrowException() throws IOException {
if (code >= 300) {
String filename = Utilities.path("[tmp]", "fhir-http-"+(++counter)+".log");
String filename = Utilities.path("[tmp]", "http-log", "fhir-http-"+(++counter)+".log");
if (content == null || content.length == 0) {
throw new IOException("Invalid HTTP response "+code+" from "+source+" ("+message+") (no content)");
} else {
Utilities.createDirectory(Utilities.path("[tmp]", "http-log"));
TextFile.bytesToFile(content, filename);
throw new IOException("Invalid HTTP response "+code+" from "+source+" ("+message+") (content in "+filename+")");
}