diff --git a/.changeset/kind-drinks-beg.md b/.changeset/kind-drinks-beg.md new file mode 100644 index 0000000000..c51d2fbd11 --- /dev/null +++ b/.changeset/kind-drinks-beg.md @@ -0,0 +1,6 @@ +--- +'@aws-amplify/backend-function': patch +'@aws-amplify/backend-storage': patch +--- + +Fix InvalidFunctionConfigurationError and InvalidStorageAccessDefinitionError error names. diff --git a/packages/backend-function/src/function_env_translator.test.ts b/packages/backend-function/src/function_env_translator.test.ts index 32dca0824c..c20535b61a 100644 --- a/packages/backend-function/src/function_env_translator.test.ts +++ b/packages/backend-function/src/function_env_translator.test.ts @@ -134,7 +134,7 @@ void describe('FunctionEnvironmentTranslator', () => { ); }, { - name: 'InvalidFunctionConfiguration', + name: 'InvalidFunctionConfigurationError', } ); }); diff --git a/packages/backend-function/src/function_env_translator.ts b/packages/backend-function/src/function_env_translator.ts index e7ffef8cd4..49da07bf9b 100644 --- a/packages/backend-function/src/function_env_translator.ts +++ b/packages/backend-function/src/function_env_translator.ts @@ -95,7 +95,7 @@ export class FunctionEnvironmentTranslator { ); } if (typeof value === 'undefined') { - throw new AmplifyUserError('InvalidFunctionConfiguration', { + throw new AmplifyUserError('InvalidFunctionConfigurationError', { message: `The value of environment variable ${key} is undefined.`, resolution: `Ensure that all defineFunction environment variables are defined.`, }); diff --git a/packages/backend-storage/src/private_types.ts b/packages/backend-storage/src/private_types.ts index b0e4530aa1..8c7e53f27a 100644 --- a/packages/backend-storage/src/private_types.ts +++ b/packages/backend-storage/src/private_types.ts @@ -8,7 +8,7 @@ import { StorageAction } from './types.js'; * Storage user error types */ export type StorageError = - | 'InvalidStorageAccessDefinition' + | 'InvalidStorageAccessDefinitionError' | 'InvalidStorageAccessPathError'; /** diff --git a/packages/backend-storage/src/storage_access_orchestrator.ts b/packages/backend-storage/src/storage_access_orchestrator.ts index 98d26f4409..e4b4c0e22a 100644 --- a/packages/backend-storage/src/storage_access_orchestrator.ts +++ b/packages/backend-storage/src/storage_access_orchestrator.ts @@ -99,7 +99,7 @@ export class StorageAccessOrchestrator { ({ uniqueDefinitionId, validationErrorOptions }) => { if (uniqueDefinitionIdSet.has(uniqueDefinitionId)) { throw new AmplifyUserError( - 'InvalidStorageAccessDefinition', + 'InvalidStorageAccessDefinitionError', validationErrorOptions ); } else {