Package lv.odylab.evemanage.application.exception.validation

Examples of lv.odylab.evemanage.application.exception.validation.InvalidItemTypeException


    @Override
    @Caching
    public ItemTypeDto getItemTypeDtoByName(String itemTypeName) throws EveDbException, InvalidItemTypeException {
        try {
            if (itemTypeName.length() == 0) {
                throw new InvalidItemTypeException(itemTypeName, ErrorCode.NAME_CANNOT_BE_EMPTY);
            }
            InvTypeBasicInfoDto invTypeBasicInfoDto = client.getTypeBasicInfoByTypeName(itemTypeName);
            return invTypeBasicInfoDto == null ? null : mapper.map(invTypeBasicInfoDto, ItemTypeDto.class);
        } catch (BadRequestException e) {
            logger.error("Caught BadRequestException", e.getMessage());
            throw new InvalidItemTypeException(e.getMessage(), ErrorCode.INVALID_ITEM_TYPE);
        } catch (RuntimeException e) {
            logger.error("Caught RuntimeException", e);
            throw new EveDbException(e);
        }
    }
View Full Code Here


    public String getTypeName(Long typeID) throws EveDbException, InvalidItemTypeException {
        try {
            return client.getTypeIdToTypeName(typeID);
        } catch (BadRequestException e) {
            logger.error("Caught BadRequestException", e);
            throw new InvalidItemTypeException(String.valueOf(typeID), ErrorCode.INVALID_NAME);
        } catch (RuntimeException e) {
            logger.error("Caught RuntimeException", e);
            throw new EveDbException(e);
        }
    }
View Full Code Here

    @Override
    public PriceSetAddItemActionResponse execute(PriceSetAddItemAction action) throws Exception {
        String typeName = action.getItemTypeName();
        ItemTypeDto itemTypeDto = clientFacade.getItemTypeByName(typeName);
        if (itemTypeDto == null) {
            throw new InvalidItemTypeException(typeName, ErrorCode.INVALID_ITEM_TYPE);
        }
        PriceSetItemDto priceSetItemDto = new PriceSetItemDto();
        priceSetItemDto.setItemTypeName(itemTypeDto.getName());
        priceSetItemDto.setItemTypeIcon(itemTypeDto.getGraphicIcon());
        priceSetItemDto.setItemTypeID(itemTypeDto.getItemTypeID());
View Full Code Here

TOP

Related Classes of lv.odylab.evemanage.application.exception.validation.InvalidItemTypeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.