Interface RequestErrorHandler

  • All Known Implementing Classes:
    RequestErrorHandlerImpl

    public interface RequestErrorHandler
    Used to wrap exceptions originating from REST calls through the charon framework.
    • Method Detail

      • processUpdateConfigurationError

        void processUpdateConfigurationError​(com.hybris.charon.exp.HttpException ex,
                                             java.lang.String configId)
                                      throws ConfigurationEngineException
        processes exception from configuration update request
        Parameters:
        ex - exception to process
        configId - configuration runtime id of the configuration that was attempted to be updated
        Throws:
        ConfigurationEngineException
      • processCreateDefaultConfigurationError

        CPSConfiguration processCreateDefaultConfigurationError​(com.hybris.charon.exp.HttpException ex)
        processes exception from configuration create default configuration request
        Parameters:
        ex - exception to process
        Returns:
        default configuration
      • processGetConfigurationError

        CPSConfiguration processGetConfigurationError​(com.hybris.charon.exp.HttpException ex,
                                                      java.lang.String configId)
                                               throws ConfigurationEngineException
        processes exception from configuration create default configuration request
        Parameters:
        ex - exception to process
        configId - configuration runtime id of the configuration that was attempted to be retrieved
        Returns:
        configuration update result
        Throws:
        ConfigurationEngineException
      • processDeleteConfigurationError

        void processDeleteConfigurationError​(com.hybris.charon.exp.HttpException ex)
        processes exception from delete configuration request
        Parameters:
        ex - exception to process
      • processGetExternalConfigurationError

        CPSExternalConfiguration processGetExternalConfigurationError​(com.hybris.charon.exp.HttpException ex,
                                                                      java.lang.String configId)
                                                               throws ConfigurationEngineException
        processes exception from get external configuration request
        Parameters:
        ex - exception to process
        configId - configuration runtime id of the external configuration that was attempted to be retrieved
        Returns:
        external representation of configuration
        Throws:
        ConfigurationEngineException - Exception on calling the configuration service (e.g. when the session has expired)
      • processCreateRuntimeConfigurationFromExternalError

        CPSConfiguration processCreateRuntimeConfigurationFromExternalError​(com.hybris.charon.exp.HttpException ex)
        processes exception from create configuration from external request
        Parameters:
        ex - exception to process
        Returns:
        runtime configuration
      • processCreatePricingDocumentError

        PricingDocumentResult processCreatePricingDocumentError​(com.hybris.charon.exp.HttpException ex)
                                                         throws PricingEngineException
        processes exception from create pricing document request
        Parameters:
        ex - exception to process
        Returns:
        pricing document result
        Throws:
        PricingEngineException - which indicates the error towards higher layers
      • processHasKbError

        boolean processHasKbError​(com.hybris.charon.exp.HttpException ex)
        processes exception from get knowledgebase request
        Parameters:
        ex - exception to process
        Returns:
        whether kb exists
      • processCreatePricingDocumentRuntimeException

        PricingDocumentResult processCreatePricingDocumentRuntimeException​(java.lang.RuntimeException ex)
                                                                    throws PricingEngineException
        Processes runtime exceptions like timeout or non-existing server. Default behavior: Timeout exceptions are handled gracefully in the sense that they are converted into PricingEngineException while other runtime exceptions are re-thrown.
        Parameters:
        ex - Runtime exception that wraps the actual root cause
        Returns:
        Dummy result of the pricing call
        Throws:
        PricingEngineException
      • processConfigurationRuntimeException

        void processConfigurationRuntimeException​(java.lang.RuntimeException e,
                                                  java.lang.String configId)
                                           throws ConfigurationEngineException
        Processes runtime exceptions like timeout or non-existing server. Default behavior: Timeout exceptions are handled gracefully in the sense that they are converted into ConfigurationEngineException while other runtime exceptions are re-thrown.
        Parameters:
        e - Runtime exception that wraps the actual root cause
        configId - configuration runtime id of the configuration that was requested
        Throws:
        ConfigurationEngineException