forked from Necoro/gitosis
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started refactoring exceptions -- *somebody* should've done it while ago
- Loading branch information
1 parent
1e67be9
commit 56b5488
Showing
3 changed files
with
45 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
gitosis.exceptions | ||
~~~~~~~~~~~~~~~~~~ | ||
This module defines a couple of exceptions raised in different | ||
parts of :mod:`gitosis`. | ||
:license: GPL | ||
""" | ||
|
||
from __future__ import unicode_literals | ||
|
||
|
||
class GitosisError(Exception): | ||
"""Base class for all :mod:`gitosis` exceptions.""" | ||
|
||
|
||
class ImproperlyConfigured(GitosisError): | ||
"""Exception raised when something is wrong with :mod:`gitosis` | ||
configuration. For example when the config file is missing or | ||
doesn't contain required configuration variable. | ||
""" | ||
|
||
|
||
class GitError(GitosisError): | ||
"""Exception raised when ``git`` comand failed to execute.""" | ||
def __init__(self, command, *args): | ||
self.command = command | ||
super(GitosisError, self).__init__(*args) | ||
|
||
def __str__(self): | ||
return "git {0} failed: {1}".format(self.command, | ||
": ".join(self.args)) |
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