From f8629b6aaf98a85699ca4960088890cabd394704 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 28 Oct 2020 18:10:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Consistency=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- royalnet/campaigns/exc.py | 15 ++++++++++++++- royalnet/{scroll => scrolls}/__init__.py | 2 +- royalnet/{scroll/errors.py => scrolls/exc.py} | 12 ++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) rename royalnet/{scroll => scrolls}/__init__.py (99%) rename royalnet/{scroll/errors.py => scrolls/exc.py} (63%) diff --git a/royalnet/campaigns/exc.py b/royalnet/campaigns/exc.py index 761ee74c..d036e2ac 100644 --- a/royalnet/campaigns/exc.py +++ b/royalnet/campaigns/exc.py @@ -1,4 +1,17 @@ -class ChallengeFailedError(Exception): +from ..errors import RoyalnetException + + +class CampaignsError(RoyalnetException): + """An error related to the campaigns module.""" + + +class ChallengeFailedError(CampaignsError): """ The data passed to the Campaign (or its async equivalent) failed the challenge. """ + + +__all__ = ( + "CampaignsError", + "ChallengeFailedError", +) diff --git a/royalnet/scroll/__init__.py b/royalnet/scrolls/__init__.py similarity index 99% rename from royalnet/scroll/__init__.py rename to royalnet/scrolls/__init__.py index 99fc3444..6557ff84 100644 --- a/royalnet/scroll/__init__.py +++ b/royalnet/scrolls/__init__.py @@ -5,7 +5,7 @@ import re import toml import json -from .errors import * +from .exc import * class Scroll: diff --git a/royalnet/scroll/errors.py b/royalnet/scrolls/exc.py similarity index 63% rename from royalnet/scroll/errors.py rename to royalnet/scrolls/exc.py index eeeb40bd..10f91fb3 100644 --- a/royalnet/scroll/errors.py +++ b/royalnet/scrolls/exc.py @@ -1,19 +1,19 @@ from ..errors import RoyalnetException -class ScrollException(RoyalnetException): - """An exception raised by the Scroll module.""" +class ScrollsException(RoyalnetException): + """An exception raised by the scrolls module.""" -class NotFoundError(ScrollException): +class NotFoundError(ScrollsException): """The requested config key was not found.""" -class InvalidFormatError(ScrollException): +class InvalidFormatError(ScrollsException): """The requested config key is not valid.""" -class ParseError(ScrollException): +class ParseError(ScrollsException): """The config value could not be parsed correctly.""" @@ -22,7 +22,7 @@ class InvalidFileType(ParseError): __all__ = ( - "ScrollException", + "ScrollsException", "NotFoundError", "InvalidFormatError", "ParseError",