import logging


def no_expansion_exception_handler(e):
    """
    Error handler to handle NoExpansion
    """
    message = 'No expansion for {}'.format(e.id)
    logging.error(message)
    return {
        'error': {
            'message': message,
            'code': 400
        }
    }, 400