mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Merge pull request #73 from Kingsrook/hotfix/file-importer
Increasing logging for s3 importer archive errors
This commit is contained in:
@ -362,7 +362,7 @@ public class FilesystemImporterStep implements BackendStep
|
|||||||
+ "-" + sourceFileName.replaceAll(".*" + File.separator, "");
|
+ "-" + sourceFileName.replaceAll(".*" + File.separator, "");
|
||||||
path = AbstractBaseFilesystemAction.stripDuplicatedSlashes(path);
|
path = AbstractBaseFilesystemAction.stripDuplicatedSlashes(path);
|
||||||
|
|
||||||
LOG.info("Archiving file", logPair("path", path));
|
LOG.info("Archiving file", logPair("path", path), logPair("archiveBackendName", archiveBackend.getName()), logPair("archiveTableName", archiveTable.getName()));
|
||||||
archiveActionBase.writeFile(archiveBackend, path, bytes);
|
archiveActionBase.writeFile(archiveBackend, path, bytes);
|
||||||
|
|
||||||
return (path);
|
return (path);
|
||||||
|
@ -42,6 +42,7 @@ import com.kingsrook.qqq.backend.module.filesystem.base.model.metadata.AbstractF
|
|||||||
import com.kingsrook.qqq.backend.module.filesystem.exceptions.FilesystemException;
|
import com.kingsrook.qqq.backend.module.filesystem.exceptions.FilesystemException;
|
||||||
import com.kingsrook.qqq.backend.module.filesystem.s3.model.metadata.S3BackendMetaData;
|
import com.kingsrook.qqq.backend.module.filesystem.s3.model.metadata.S3BackendMetaData;
|
||||||
import com.kingsrook.qqq.backend.module.filesystem.s3.utils.S3Utils;
|
import com.kingsrook.qqq.backend.module.filesystem.s3.utils.S3Utils;
|
||||||
|
import static com.kingsrook.qqq.backend.core.logging.LogUtils.logPair;
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -162,10 +163,19 @@ public class AbstractS3Action extends AbstractBaseFilesystemAction<S3ObjectSumma
|
|||||||
@Override
|
@Override
|
||||||
public void writeFile(QBackendMetaData backendMetaData, String path, byte[] contents) throws IOException
|
public void writeFile(QBackendMetaData backendMetaData, String path, byte[] contents) throws IOException
|
||||||
{
|
{
|
||||||
path = stripLeadingSlash(stripDuplicatedSlashes(path));
|
|
||||||
String bucketName = ((S3BackendMetaData) backendMetaData).getBucketName();
|
String bucketName = ((S3BackendMetaData) backendMetaData).getBucketName();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
path = stripLeadingSlash(stripDuplicatedSlashes(path));
|
||||||
getS3Utils().writeFile(bucketName, path, contents);
|
getS3Utils().writeFile(bucketName, path, contents);
|
||||||
}
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
LOG.warn("Error writing file", e, logPair("path", path), logPair("bucketName", bucketName));
|
||||||
|
throw (new IOException("Error writing file", e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user