class ServiceError(Exception):
    """Base class for errors raised by services; `message` is safe to show to a client."""

    def __init__(self, message: str):
        super().__init__(message)
        self.message = message


class ValidationError(ServiceError):
    """The input is malformed or not allowed."""


class NotFound(ServiceError):
    """The referenced object does not exist."""


class Forbidden(ServiceError):
    """The caller may not act on this object."""


class UpstreamError(ServiceError):
    """Facebook or another upstream service failed."""
