cc-4105: Added exceptions classes. Created config wrapper class

This commit is contained in:
Rudi Grinberg 2012-07-18 14:27:36 -04:00
parent 45385dffce
commit 76cac68fe7
2 changed files with 46 additions and 3 deletions

View file

@ -1,7 +1,14 @@
# -*- coding: utf-8 -*-
class BadSongFile(Exception):
def __init__(self, path):
self.path = path
def __init__(self, path): self.path = path
def __str__(self): return "Can't read %s" % self.path
class NoConfigFile(Exception):
def __init__(self, path): self.path = path
def __str__(self):
return "Can't read %s" % self.path
return "Path '%s' for config file does not exit" % self.path
class ConfigAccessViolation(Exception):
def __init__(self,key): self.key = key
def __str__(self): return "You must not access key '%s' directly" % self.key