How to use the @shopgate/pwa-core/helpers.logger.error function in @shopgate/pwa-core

To help you get started, we’ve selected a few @shopgate/pwa-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shopgate / pwa / libraries / ui-shared / Form / Builder / classes / ActionListener / index.jsx View on Github external
}
        case ACTION_RULE_TYPE_BOOLEAN: {
          tmpResult = ruleData;
          break;
        }
        case ACTION_RULE_TYPE_REGEX: {
          const regexParts = ruleData.split('/');
          let regexPattern = '';
          let regexParam = '';
          if (regexParts.length === 1) {
            [regexPattern] = regexParts;
          } else if (regexParts.length === 3) {
            regexParts.shift();
            [regexPattern, regexParam = ''] = regexParts;
          } else {
            logger.error(`Error: Invalid regex string in action rule in element ${element.id}`);
            break;
          }

          const regex = new RegExp(regexPattern, regexParam);
          tmpResult = regex.test(nextState.formData[rule.context]);
          break;
        }
        default: break;
      }

      // Concat rules based on the rule concat method of the action
      result = concatRules(result, tmpResult);
    });
github shopgate / pwa / libraries / common / collections / media-providers / MediaProvider.js View on Github external
stop() {
    logger.error('MediaProvider.stop() needs to be implemented within an inheriting class');
    return this;
  }
}
github shopgate / pwa / libraries / commerce / category / actions / fetchRootCategories.js View on Github external
.catch((error) => {
      logger.error(error);
      dispatch(errorRootCategories());
    });
};
github shopgate / pwa / libraries / commerce / product / actions / fetchProductMedia.js View on Github external
.catch((error) => {
      logger.error(error);
      dispatch(errorProductMedia(productId, error.code));
    });
};
github shopgate / pwa / libraries / commerce / cart / actions / updateProductsInCart.js View on Github external
.catch((error) => {
      const requestsPending = request.hasPendingRequests();
      dispatch(errorUpdateProductsInCart(updateData, undefined, requestsPending));
      logger.error('updateProductsInCart', error);
    });
};
github shopgate / pwa / libraries / commerce / filter / actions / fetchFilters.js View on Github external
.catch((error) => {
      logger.error(error);
      dispatch(errorFilters(hash));
    });
};
github shopgate / pwa / libraries / common / actions / user / getUser.js View on Github external
.catch((error) => {
      const { code } = error;

      switch (code) {
        case EACCESS:
          dispatch(toggleLoggedIn(false));
          break;
        default:
          logger.error(error);
          break;
      }

      dispatch(errorUser());
    });
};
github shopgate / pwa / libraries / commerce / product / actions / fetchProductRelations.js View on Github external
.catch((err) => {
        logger.error(err);
        dispatch(errorProductRelations({ hash }));
      });
github shopgate / pwa / libraries / commerce / filter / actions / commitTemporaryFilters.js View on Github external
const commitTemporaryFilters = (roundDisplayAmounts = true) => (dispatch, getState) => {
  const state = getState();
  const activeFilters = getActiveFiltersStack(state);
  let temporaryFilters;

  if (roundDisplayAmounts) {
    temporaryFilters = getTemporaryFiltersWithRoundedDisplayAmounts(state);
  } else {
    temporaryFilters = getTemporaryFilters(state);
  }

  if (!activeFilters.length) {
    logger.error('Tried to submit temporary filters, but no active filter stack was created.');
    return;
  }

  if (!shallowEqual(temporaryFilters, activeFilters[activeFilters.length - 1].filters)) {
    const categoryId = getCurrentCategoryId(state);
    const searchPhrase = getSearchPhrase(state);

    dispatch(setActiveFilters(temporaryFilters, {
      ...categoryId && { categoryId },
      ...searchPhrase && { searchPhrase },
    }));

    const params = {
      ...categoryId && { categoryId },
      ...searchPhrase && { searchPhrase },
      limit: ITEMS_PER_LOAD,
github shopgate / pwa / libraries / commerce / cart / actions / deleteProductsFromCart.js View on Github external
.catch((error) => {
      const requestsPending = request.hasPendingRequests();
      dispatch(errorDeleteProductsFromCart(cartItemIds, undefined, requestsPending));
      logger.error('deleteProductsFromCart', error);
    });
};