-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove batch size limit and use buffers (#2627)
* remove batch size limit and use buffers * fix test * add proper error handling on the put call * add tests for isAWSError * use APIError * set default batch size to 100k * fix generated types
- Loading branch information
1 parent
f455c37
commit 98504f7
Showing
7 changed files
with
108 additions
and
40 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
packages/destination-actions/src/destinations/s3/__tests__/client.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { isAWSError } from '../client' | ||
import { _Error as AWSError } from '@aws-sdk/client-s3' | ||
|
||
describe('isAWSError', () => { | ||
it('should return true for a valid AWS error', () => { | ||
const error: AWSError = { | ||
Code: 'AccessDenied', | ||
Message: 'Access Denied' | ||
} | ||
expect(isAWSError(error)).toBe(true) | ||
}) | ||
|
||
it('should return false for a non-AWS error', () => { | ||
const error = new Error('Some other error') | ||
expect(isAWSError(error)).toBe(false) | ||
}) | ||
|
||
it('should return false for an object without Code and Message properties', () => { | ||
const error = { name: 'SomeError', message: 'Some error message' } | ||
expect(isAWSError(error)).toBe(false) | ||
}) | ||
|
||
it('should return false for null', () => { | ||
expect(isAWSError(null)).toBe(false) | ||
}) | ||
|
||
it('should return false for undefined', () => { | ||
expect(isAWSError(undefined)).toBe(false) | ||
}) | ||
|
||
it('should return false for a string', () => { | ||
expect(isAWSError('Some error')).toBe(false) | ||
}) | ||
|
||
it('should return false for a number', () => { | ||
expect(isAWSError(123)).toBe(false) | ||
}) | ||
|
||
it('should return false for an object without Code property', () => { | ||
const error = { Message: 'Some error message' } | ||
expect(isAWSError(error)).toBe(false) | ||
}) | ||
|
||
it('should return false for an object without Message property', () => { | ||
const error = { Code: 'SomeError' } | ||
expect(isAWSError(error)).toBe(false) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/destination-actions/src/destinations/s3/syncToS3/generated-types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.