export enum CommonResourceServiceError {
UNIQUE_VIOLATION = 'UniqueViolation',
OWNERSHIP_CYCLE = 'OwnershipCycle',
+ MODIFYING_CONTAINER_REQUEST_FINAL_STATE = 'ModifyingContainerRequestFinalState',
UNKNOWN = 'Unknown',
NONE = 'None'
}
export class CommonResourceService<T extends Resource> {
- static mapResponseKeys = (response: any): Promise<any> =>
+ static mapResponseKeys = (response: { data: any }): Promise<any> =>
CommonResourceService.mapKeys(_.camelCase)(response.data)
static mapKeys = (mapFn: (key: string) => string) =>
return CommonResourceServiceError.UNIQUE_VIOLATION;
case /ownership cycle/.test(error):
return CommonResourceServiceError.OWNERSHIP_CYCLE;
+ case /Mounts cannot be modified in state 'Final'/.test(error):
+ return CommonResourceServiceError.MODIFYING_CONTAINER_REQUEST_FINAL_STATE;
default:
return CommonResourceServiceError.UNKNOWN;
}