errors.py 736 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
"""Errors thrown in the Team API"""


class TeamAPIRequestError(Exception):
    """There was a problem with a request to the Team API."""
    pass


class NotEnrolledInCourseForTeam(TeamAPIRequestError):
    """User is not enrolled in the course for the team they are trying to join."""
    pass


class AlreadyOnTeamInCourse(TeamAPIRequestError):
    """User is already a member of another team in the same course."""
    pass
17 18


19 20 21 22 23
class ElasticSearchConnectionError(TeamAPIRequestError):
    """The system was unable to connect to the configured elasticsearch instance."""
    pass


24
class ImmutableMembershipFieldException(Exception):
25
    """An attempt was made to change an immutable field on a CourseTeamMembership model."""
26
    pass