-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
- Loading branch information
Showing
2 changed files
with
34 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class ConfigurationError(Exception): | ||
def __init__(self, msg): | ||
self.msg = msg | ||
|
||
def __str__(self): | ||
return self.msg | ||
|
||
|
||
class CircularReference(ConfigurationError): | ||
def __init__(self, trail): | ||
self.trail = trail | ||
|
||
@property | ||
def msg(self): | ||
lines = [ | ||
"{} in {}".format(service_name, filename) | ||
for (filename, service_name) in self.trail | ||
] | ||
return "Circular reference:\n {}".format("\n extends ".join(lines)) | ||
|
||
|
||
class ComposeFileNotFound(ConfigurationError): | ||
def __init__(self, supported_filenames): | ||
super(ComposeFileNotFound, self).__init__(""" | ||
Can't find a suitable configuration file in this directory or any parent. Are you in the right directory? | ||
Supported filenames: %s | ||
""" % ", ".join(supported_filenames)) |