Skip to content

Commit baf5a19

Browse files
committed
Remove OptionalError
1 parent 2625af6 commit baf5a19

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

types/Build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import {
66
} from '../enums/build';
77
import { ActivitySource } from './Activity';
88
import { DeployStatusTaskLocator } from './Deploy';
9-
import { OptionalError } from './Error';
9+
import { ProjectStandardError } from './Project';
1010

1111
export type SubbuildStatus = {
1212
buildName: string;
1313
buildType: ValueOf<typeof SUBBUILD_TYPES>;
1414
errorMessage: string;
1515
finishedAt: string;
1616
rootPath: string;
17-
standardError?: OptionalError;
17+
standardError: ProjectStandardError | null;
1818
startedAt: string;
1919
status: ValueOf<typeof BUILD_STATUS>;
2020
id: string;

types/Deploy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ValueOf } from './Utils';
22
import { ACTIVITY_SOURCE } from '../enums/project';
33
import { DEPLOY_ACTION, DEPLOY_STATUS } from '../enums/deploy';
44
import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build';
5-
import { OptionalError } from './Error';
5+
import { ProjectStandardError } from './Project';
66

77
export type DeployStatus = ValueOf<typeof DEPLOY_STATUS>;
88

@@ -14,7 +14,7 @@ export type SubdeployStatus = {
1414
| ValueOf<typeof SUBCOMPONENT_TYPES>;
1515
errorMessage: string;
1616
finishedAt: string;
17-
standardError?: OptionalError;
17+
standardError: ProjectStandardError | null;
1818
startedAt: string;
1919
status: DeployStatus;
2020
id: string;

types/Error.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export interface HubSpotHttpErrorContext extends FileSystemErrorContext {
3636
projectName?: string;
3737
}
3838

39-
export type OptionalError = BaseError | null | undefined;
40-
4139
export type ErrorContext = {
4240
accountId?: number;
4341
};

types/Migration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ValueOf } from './Utils';
2-
import { OptionalError } from './Error';
2+
import { ProjectStandardError } from './Project';
3+
34
export const MIGRATION_STATUS = {
45
BUILDING: 'BUILDING',
56
FAILURE: 'FAILURE',
@@ -21,6 +22,6 @@ export type CloneAppResponse = {
2122
export type PollAppResponse = {
2223
id: number;
2324
project?: { id: number; name: string; buildId: number; deployId: number };
24-
error?: OptionalError;
25+
error: ProjectStandardError | null;
2526
status: ValueOf<typeof MIGRATION_STATUS>;
2627
};

types/Project.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,20 @@ export type FetchPlatformVersionResponse = {
4545
defaultPlatformVersion: string;
4646
activePlatformVersions: Array<string>;
4747
};
48+
49+
export type ProjectStandardError = {
50+
status: string;
51+
id?: string;
52+
category: string;
53+
subCategory?: string;
54+
message?: string;
55+
errors?: Array<{
56+
message: string;
57+
in?: string;
58+
code?: string;
59+
subcateogy?: string;
60+
context: object;
61+
}>;
62+
context: object;
63+
links: { [key: string]: string };
64+
};

0 commit comments

Comments
 (0)