1 import { API_CUSTOM_ERROR_CODES, HTTP_ERROR_CODES } from '@proton/shared/lib/errors';
3 export const isErrorDueToNameConflict = (err: any): boolean =>
4 typeof err === 'object' &&
5 err.status === HTTP_ERROR_CODES.UNPROCESSABLE_ENTITY &&
6 err.data?.Code === API_CUSTOM_ERROR_CODES.ALREADY_EXISTS;