Esempio n. 1
0
def call_default_exception_handler(exc, context):
    response = None
    handler = ModuleConfiguration.get_default_api_error_handler()
    if handler:
        # Call default exception handler which can be defined in separate IMIS handler
        func = FunctionUtils.get_function_by_str(handler)
        if func:
            response = func(exc, context)
    else:
        # Call REST framework's default exception handler first, to get the standard error response.
        response = exception_handler(exc, context)
    return response
Esempio n. 2
0
 def __configure_module(self, cfg):
     ModuleConfiguration.build_configuration(cfg)
     logger.info('Module $s configured successfully', MODULE_NAME)
Esempio n. 3
0
 def ready(self):
     from core.models import ModuleConfiguration
     cfg = ModuleConfiguration.get_or_default(MODULE_NAME, DEFAULT_CFG)
     self.__configure_module(cfg)