Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class DuplicateFriendship(FortniteException):
"""This exception is raised whenever the client attempts to add a user as
friend when the friendship already exists."""
pass
class FriendshipRequestAlreadySent(FortniteException):
"""This exception is raised whenever the client attempts to send a friend
request to a user that has already received a friend request from the
client.
"""
pass
class ValidationFailure(FortniteException):
"""Represents a validation failure returned.
Attributes
----------
field_name: :class:`str`
Name of the field that was invalid.
invalid_value: :class:`str`
The invalid value.
message: :class:`str`
The message explaining why the field value was invalid.
message_code: :class:`str`
The raw error message code received.
message_vars: Dict[:class:`str`, :class:`str`]
The message variables received.
"""
self.original = original
class EventError(FortniteException):
"""This exception is raised when something regarding events fails."""
pass
class XMPPError(FortniteException):
"""This exception is raised when something regarding the XMPP service
fails.
"""
pass
class PartyError(FortniteException):
"""This exception is raised when something regarding parties fails."""
pass
class Forbidden(FortniteException):
"""This exception is raised whenever you attempted a request that your
account does not have permission to do.
"""
pass
class NotFound(FortniteException):
"""This exception is raised when something was not found by fortnites
services.
"""
pass
pass
class PartyError(FortniteException):
"""This exception is raised when something regarding parties fails."""
pass
class Forbidden(FortniteException):
"""This exception is raised whenever you attempted a request that your
account does not have permission to do.
"""
pass
class NotFound(FortniteException):
"""This exception is raised when something was not found by fortnites
services.
"""
pass
class NoMoreItems(FortniteException):
"""This exception is raised whenever an iterator does not have any more
items.
"""
pass
class DuplicateFriendship(FortniteException):
"""This exception is raised whenever the client attempts to add a user as
friend when the friendship already exists."""
class AuthException(FortniteException):
"""This exception is raised when auth fails by invalid credentials
passed or some other misc failure.
Attributes
----------
original: :exc:`FortniteException`
The original exception raised. The original error always inherits from
:exc:`FortniteException`.
"""
def __init__(self, message: str, original: Exception) -> None:
super().__init__(message)
self.original = original
class EventError(FortniteException):
"""This exception is raised when something regarding events fails."""
pass
class XMPPError(FortniteException):
"""This exception is raised when something regarding the XMPP service
fails.
"""
pass
class PartyError(FortniteException):
"""This exception is raised when something regarding parties fails."""
pass
SOFTWARE.
"""
from aiohttp import ClientResponse
class FortniteException(Exception):
"""Base exception for fortnitepy.
This could in theory be caught to handle all exceptions thrown by this
library.
"""
pass
class AuthException(FortniteException):
"""This exception is raised when auth fails by invalid credentials
passed or some other misc failure.
Attributes
----------
original: :exc:`FortniteException`
The original exception raised. The original error always inherits from
:exc:`FortniteException`.
"""
def __init__(self, message: str, original: Exception) -> None:
super().__init__(message)
self.original = original
class EventError(FortniteException):
"""This exception is raised when something regarding events fails."""
pass
class XMPPError(FortniteException):
"""This exception is raised when something regarding the XMPP service
fails.
"""
pass
class PartyError(FortniteException):
"""This exception is raised when something regarding parties fails."""
pass
class Forbidden(FortniteException):
"""This exception is raised whenever you attempted a request that your
account does not have permission to do.
"""
pass
class NotFound(FortniteException):
"""This exception is raised when something was not found by fortnites
services.
"""
pass
class NoMoreItems(FortniteException):
"""This exception is raised whenever an iterator does not have any more
items.
class Forbidden(FortniteException):
"""This exception is raised whenever you attempted a request that your
account does not have permission to do.
"""
pass
class NotFound(FortniteException):
"""This exception is raised when something was not found by fortnites
services.
"""
pass
class NoMoreItems(FortniteException):
"""This exception is raised whenever an iterator does not have any more
items.
"""
pass
class DuplicateFriendship(FortniteException):
"""This exception is raised whenever the client attempts to add a user as
friend when the friendship already exists."""
pass
class FriendshipRequestAlreadySent(FortniteException):
"""This exception is raised whenever the client attempts to send a friend
request to a user that has already received a friend request from the
client.
class NoMoreItems(FortniteException):
"""This exception is raised whenever an iterator does not have any more
items.
"""
pass
class DuplicateFriendship(FortniteException):
"""This exception is raised whenever the client attempts to add a user as
friend when the friendship already exists."""
pass
class FriendshipRequestAlreadySent(FortniteException):
"""This exception is raised whenever the client attempts to send a friend
request to a user that has already received a friend request from the
client.
"""
pass
class ValidationFailure(FortniteException):
"""Represents a validation failure returned.
Attributes
----------
field_name: :class:`str`
Name of the field that was invalid.
invalid_value: :class:`str`
The invalid value.
The message explaining why the field value was invalid.
message_code: :class:`str`
The raw error message code received.
message_vars: Dict[:class:`str`, :class:`str`]
The message variables received.
"""
def __init__(self, data: dict) -> None:
self.field_name = data['fieldName']
self.invalid_value = data['invalidValue']
self.message = data['errorMessage']
self.message_code = data['errorCode']
self.message_vars = data['messageVars']
class HTTPException(FortniteException):
"""This exception is raised when an error is received by Fortnite services.
Attributes
----------
response: :class:`aiohttp.ClientResponse`
The response from the HTTP request.
text: :class:`str`
The error message.
status: :class:`int`
The status code of the HTTP request.
raw: Union[:class:`str`, :class:`dict`]
The raw message/data received from Fortnite services.
message: :class:`str`
The raw error message received from Fortnite services.
message_code: :class:`str`
The raw error message code received from Fortnite services.
----------
original: :exc:`FortniteException`
The original exception raised. The original error always inherits from
:exc:`FortniteException`.
"""
def __init__(self, message: str, original: Exception) -> None:
super().__init__(message)
self.original = original
class EventError(FortniteException):
"""This exception is raised when something regarding events fails."""
pass
class XMPPError(FortniteException):
"""This exception is raised when something regarding the XMPP service
fails.
"""
pass
class PartyError(FortniteException):
"""This exception is raised when something regarding parties fails."""
pass
class Forbidden(FortniteException):
"""This exception is raised whenever you attempted a request that your
account does not have permission to do.
"""
pass