UNPKG

dynamodb-ts-model

Version:

A DynamoDB model/client with full TypeScript typings

24 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDynamoError = void 0; const client_dynamodb_1 = require("@aws-sdk/client-dynamodb"); const DynamoErrorNames = { AccessDenied: 'AccessDeniedException', ConditionalCheckFailed: 'ConditionalCheckFailedException', DuplicateItem: 'DuplicateItemException', ItemCollectionSizeLimitExceeded: 'ItemCollectionSizeLimitExceededException', ProvisionedThroughputExceeded: 'ProvisionedThroughputExceededException', RequestLimitExceeded: 'RequestLimitExceeded', ResourceNotFound: 'ResourceNotFoundException', ThrottlingError: 'ThrottlingException', TransactionConflict: 'TransactionConflictException', ValidationError: 'ValidationException' }; /** * Check if err is a DynamoDB service error of the given name */ function isDynamoError(err, name) { return err instanceof client_dynamodb_1.DynamoDBServiceException && err.name === DynamoErrorNames[name]; } exports.isDynamoError = isDynamoError; //# sourceMappingURL=errors.js.map