Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #13 from JLpython-py/leaders/SplitsLeaderboards
Browse files Browse the repository at this point in the history
Leaders/SplitsLeaderboards
  • Loading branch information
JacobLee23 authored Mar 24, 2021
2 parents 16b96fb + 4a6835d commit 0bb9437
Show file tree
Hide file tree
Showing 10 changed files with 1,572 additions and 1,123 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ virtualenv/
.idea/
*.log
out/
.vs/
45 changes: 43 additions & 2 deletions FanGraphs/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
#! python3
# FanGraphs/exceptions.py

"""
The warnings and exceptions used by modules in the package.
================================================================================
"""

class InvalidFilterQuery(Exception):

class FilterUpdateIncapabilityWarning(Warning):

def __init__(self):
"""
Raised when the filter queries cannot be updated.
This usually occurs when no filter queries have been configured since the last update.
"""
self.message = "No filter query configurations to update"
super().__init__(self.message)


class UnknownBrowserException(Exception):

def __init__(self, browser):
"""
Raised when the browser name given is not recognized.
:param browser: The name of the browser used
"""
self.browser = browser
self.message = f"No browser named '{self.browser}' was recognized"
super().__init__(self.message)


class InvalidFilterQueryException(Exception):

def __init__(self, query):
"""
Expand All @@ -15,7 +44,7 @@ def __init__(self, query):
super().__init__(self.message)


class InvalidFilterOption(Exception):
class InvalidFilterOptionException(Exception):

def __init__(self, query, option):
"""
Expand All @@ -27,3 +56,15 @@ def __init__(self, query, option):
self.query, self.option = query, option
self.message = f"No option '{self.option}' could be found for query '{self.query}'"
super().__init__(self.message)


class InvalidQuickSplitException(Exception):

def __init__(self, quick_split):
"""
:param quick_split:
"""
self.quick_split = quick_split
self.message = f"No quick split '{self.quick_split}` could be found"
super().__init__(self.message)
Loading

0 comments on commit 0bb9437

Please sign in to comment.