aboutsummaryrefslogtreecommitdiff
path: root/scripts/exceptions.py
blob: 889dbe60b302c384b8cfdfd17267ddbab9940937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class MissingFile(Exception):
	def __init__(self, f, advice):
		self.f = f
		self.advice = advice
	def __str__(self):
		if advice == None:
			return "No required file: " + f 
		else:
			return "No required file: " + f + "\n" + advice

class NoSolution(Exception):
	def __init__(self):
		pass
	def __str__(self):
		return "SAT solver found no solution. Statement is not satisfiable."

class ConfigurationError(Exception):
	def __init__(self, message):
		self.message = message;
	def __str__(self):
		return "Configuration error: " + message

class NoNewConfiguration(Exception):
	def __init__(self):
		pass
	def __str__(self):
		return "No new configuration generated"
class NoApplicableConfiguration(Exception):
	def __init__(self):
		pass
	def __str__(self):
		return "No applicable configuration find. All generated configurations were already applied."

class ProcessFailed(Exception):
	def __init__(self, process, returncode, output):
		self.process = process
		self.returncode = returncode
		self.output = output
	def __str__(self):
		return "Process failed: " + str(self.process) + \
			" with return code: " + str(self.returncode)

class ProcessTimeout(Exception):
	def __init__(self, process, output):
		self.process = process
		self.output = output
	def __str__(self):
		return "Process timeout: " + str(self.process)

class DatabaseUninitialized(Exception):
	def __str__(self):
		return "Database seems to be uninitialized."

class DirtyRepository(Exception):
	def __init__(self, repo):
		self.repo = repo
	def __str__(self):
		return "Detected dirty repository: " + self.repo