diff --git a/lib/aws.ts b/lib/aws.ts index ac13e0b..c743701 100644 --- a/lib/aws.ts +++ b/lib/aws.ts @@ -154,16 +154,11 @@ export class DefaultAwsClient implements IAws { listObjectsV2: (input: ListObjectsV2CommandInput): Promise => client.send(new ListObjectsV2Command(input)), upload: (input: PutObjectCommandInput): Promise => { - try { - const upload = new Upload({ - client, - params: input, - }); - return upload.done(); - } catch (e: any) { - console.log(`Asset upload failed: '${e.message}'`); - throw e; - } + const upload = new Upload({ + client, + params: input, + }); + return upload.done(); }, }; } diff --git a/test/files.test.ts b/test/files.test.ts index 4c9bb3c..0edc3f0 100644 --- a/test/files.test.ts +++ b/test/files.test.ts @@ -328,9 +328,9 @@ test('correctly identify asset path if path is absolute', async () => { const pub = new AssetPublishing(AssetManifest.fromPath(mockfs.path('/abs/cdk.out')), { aws }); s3.on(ListObjectsV2Command).resolves({ Contents: undefined }); - expect(async () => { - await pub.publish(); - }).not.toThrow(); + await pub.publish(); + + // THEN: doesn't throw }); describe('external assets', () => { @@ -365,7 +365,7 @@ describe('external assets', () => { await pub.publish(); - expect(s3).toHaveReceivedCommandTimes(PutObjectCommand, 2); + expect(s3).toHaveReceivedCommandTimes(PutObjectCommand, 1); expectAllSpawns(); });