Skip to content

Commit 7728344

Browse files
chore: Update errorCategory API to align with AWS standard error names (#3639)
1 parent b1e909b commit 7728344

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

pages/funnel-analytics/static-single-page-flow.page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ export default function StaticSinglePageCreatePage() {
8888
{
8989
analyticsMetadata: {
9090
errorContext: {
91-
errorCategory: 'api_specific',
92-
errorSubCategory: 'access_control',
91+
errorCategory: 'API_SPECIFIC',
92+
errorSubCategory: 'ACCESS_CONTROL_ISSUES',
9393
errorMessage: 'This is a dismissible error message.',
9494
},
9595
},
@@ -149,8 +149,8 @@ export default function StaticSinglePageCreatePage() {
149149
const errorMessage = 'There is an error';
150150
setErrorText('There is an error');
151151
setFunnelErrorContext({
152-
errorCategory: 'api_specific',
153-
errorSubCategory: 'connection',
152+
errorCategory: 'API_SPECIFIC',
153+
errorSubCategory: 'CONNECTION_PROBLEMS',
154154
errorMessage,
155155
});
156156
} else {
@@ -205,8 +205,8 @@ export default function StaticSinglePageCreatePage() {
205205
const errorMessage = 'Trigger error';
206206
setFieldError(errorMessage);
207207
setFieldErrorContext({
208-
errorCategory: 'input_validation',
209-
errorSubCategory: 'access_control',
208+
errorCategory: 'INPUT_VALIDATION',
209+
errorSubCategory: 'ACCESS_CONTROL_ISSUES',
210210
errorMessage,
211211
});
212212
} else {

src/alert/__tests__/alert-analytics.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ describe('Alert Analytics', () => {
207207
type="error"
208208
analyticsMetadata={{
209209
errorContext: {
210-
errorCategory: 'api_specific',
211-
errorSubCategory: 'access_control',
210+
errorCategory: 'API_SPECIFIC',
211+
errorSubCategory: 'ACCESS_CONTROL_ISSUES',
212212
errorMessage: 'This is an error text from errorContext',
213213
},
214214
}}
@@ -225,8 +225,8 @@ describe('Alert Analytics', () => {
225225
expect(FunnelMetrics.funnelError).toHaveBeenCalledWith(
226226
expect.objectContaining({
227227
errorContext: {
228-
errorCategory: 'api_specific',
229-
errorSubCategory: 'access_control',
228+
errorCategory: 'API_SPECIFIC',
229+
errorSubCategory: 'ACCESS_CONTROL_ISSUES',
230230
errorMessage: 'This is an error text from errorContext',
231231
},
232232
})

src/internal/analytics/__integ__/static-single-page-flow.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ describe.each(['refresh', 'refresh-toolbar'] as Theme[])('%s', theme => {
328328
stepNumber: 1,
329329
subStepName: 'Container 1 - header',
330330
errorContext: {
331-
errorCategory: 'input_validation',
332-
errorSubCategory: 'access_control',
331+
errorCategory: 'INPUT_VALIDATION',
332+
errorSubCategory: 'ACCESS_CONTROL_ISSUES',
333333
errorMessage: 'Trigger error',
334334
},
335335
fieldIdentifier: 'field1',

src/internal/analytics/interfaces.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ export type FunnelType = 'single-page' | 'multi-page' | 'modal';
55
export type FlowType = 'create' | 'edit' | 'delete' | 'home' | 'dashboard' | 'view-resource';
66

77
type ErrorSubCategory =
8-
| 'data_format'
9-
| 'parameter_validation'
10-
| 'access_control'
11-
| 'identity_management'
12-
| 'resource_state'
13-
| 'resource_capacity'
14-
| 'connection'
15-
| 'network_config'
16-
| 'resource_limit'
17-
| 'service_quota'
18-
| 'service_integration'
19-
| 'resource_config'
20-
| 'service_operations'
21-
| 'api_request'
22-
| 'other';
8+
| 'DATA_FORMAT_ISSUES'
9+
| 'PARAMETER_VALIDATION_ISSUES'
10+
| 'ACCESS_CONTROL_ISSUES'
11+
| 'IDENTITY_MANAGEMENT_PROBLEMS'
12+
| 'RESOURCE_STATE_ISSUES'
13+
| 'RESOURCE_CAPACITY_PROBLEMS'
14+
| 'CONNECTION_PROBLEMS'
15+
| 'NETWORK_CONFIGURATION_ISSUES'
16+
| 'RESOURCE_LIMIT_EXCEEDED'
17+
| 'SERVICE_QUOTA_RESTRICTIONS'
18+
| 'SERVICE_INTEGRATION_CONFLICTS'
19+
| 'RESOURCE_CONFIGURATION_MISMATCHES'
20+
| 'SERVICE_SPECIFIC_OPERATIONS'
21+
| 'API_REQUEST_PROBLEMS'
22+
| 'OTHER';
2323

2424
type ErrorCategory =
25-
| 'input_validation'
26-
| 'permission'
27-
| 'resource_availability'
28-
| 'network'
29-
| 'service_limits'
30-
| 'configuration'
31-
| 'api_specific'
32-
| 'other';
25+
| 'INPUT_VALIDATION'
26+
| 'PERMISSION_IAM'
27+
| 'RESOURCE_AVAILABILITY'
28+
| 'NETWORK_CONNECTIVITY'
29+
| 'SERVICE_QUOTAS_LIMITS'
30+
| 'CONFIGURATION_CONFLICTS'
31+
| 'API_SPECIFIC'
32+
| 'OTHER';
3333

3434
export interface ErrorContext {
3535
errorCategory: ErrorCategory;

0 commit comments

Comments
 (0)