TimeoutException   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 2
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 2
rs 10
wmc 0
1
class JobException(Exception):
2
    '''
3
    An exception that occured while using
4
    the Job API.
5
    '''
6
    def __init__(self, info_student=None, info_tutor=None):
7
        self.info_student = info_student
8
        self.info_tutor = info_tutor
9
    pass
10
11
12
class RunningProgramException(Exception):
13
    def __init__(self, instance, output=None):
14
        '''
15
        A problem that occured while running a student program.
16
        The instance parameter stores the
17
        RunningProgram instance raising this
18
        issue.
19
        The output paramete stores all the output data
20
        being produces so far.
21
        '''
22
        self.instance = instance
23
        self.output = output
24
25
26
class WrongExitStatusException(RunningProgramException):
27
    def __init__(self, instance, expected, got=None, output=None):
28
        self.instance = instance
29
        self.expected = expected
30
        self.output = output
31
        self.got = got
32
33
34
class NestedException(RunningProgramException):
35
    '''
36
    An exception occured while running the student
37
    program.
38
    '''
39
    def __init__(self, instance, real_exception, output=None):
40
        self.instance = instance
41
        self.real_exception = real_exception
42
        self.output = output
43
44
45
class TimeoutException(NestedException):
46
    pass
47
48
49
class TerminationException(NestedException):
50
    pass
51
52
53
class ValidatorBrokenException(JobException):
54
    '''
55
    Indication that the validator script is broken.
56
    '''
57
    pass
58