<gh_stars>0
from modules.api.handlers.abstracts.error_code_handler import ErrorCodeHandler
from modules.user.exceptions.user.user_create_error import UserCreateError
from modules.user.exceptions.user.user_search_error import UserSearchError
from modules.user.exceptions.user_ticket_name_error import UserTicketNameError
from modules.user.exceptions.user_ticket_password_error import UserTicketPasswordError
from modules.user.exceptions.user_ticket_username_error import UserTicketUsernameError


class UsersErrorCodeHandler(ErrorCodeHandler):
    """ Child object for users API error codes
    """
    def __init__(self):
        """ Constructor for UserErrorCodeHandler
        """
        super().__init__({
            UserTicketNameError.__name__: self.INTERNAL_SERVER_ERROR,
            UserTicketPasswordError.__name__: self.INTERNAL_SERVER_ERROR,
            UserTicketUsernameError.__name__: self.INTERNAL_SERVER_ERROR,
            UserCreateError.__name__: self.INTERNAL_SERVER_ERROR,
            UserSearchError.__name__: self.NOT_FOUND
        })

from modules.api.handlers.abstracts.error_code_handler import ErrorCodeHandler
from modules.user.exceptions.user.user_create_error import UserCreateError
from modules.user.exceptions.user.user_search_error import UserSearchError
from modules.user.exceptions.user_ticket_name_error import UserTicketNameError
from modules.user.exceptions.user_ticket_password_error import UserTicketPasswordError
from modules.user.exceptions.user_ticket_username_error import UserTicketUsernameError


class UsersErrorCodeHandler(ErrorCodeHandler):
    """ Child object for users API error codes
    """
    def __init__(self):
        """ Constructor for UserErrorCodeHandler
        """
        super().__init__({
            UserTicketNameError.__name__: self.INTERNAL_SERVER_ERROR,
            UserTicketPasswordError.__name__: self.INTERNAL_SERVER_ERROR,
            UserTicketUsernameError.__name__: self.INTERNAL_SERVER_ERROR,
            UserCreateError.__name__: self.INTERNAL_SERVER_ERROR,
            UserSearchError.__name__: self.NOT_FOUND
        })
Child object for users API error codes Constructor for UserErrorCodeHandler