Exception: Course::Assessment::ProgrammingEvaluationService::Error

Inherits:
StandardError
  • Object
show all
Defined in:
app/services/course/assessment/programming_evaluation_service.rb

Overview

Represents an error while evaluating the package.

Direct Known Subclasses

TimeLimitExceededError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = self.class.name, stdout = nil, stderr = nil) ⇒ Error

Returns a new instance of Error


49
50
51
52
53
# File 'app/services/course/assessment/programming_evaluation_service.rb', line 49

def initialize(message = self.class.name, stdout = nil, stderr = nil)
  super(message)
  @stdout = stdout
  @stderr = stderr
end

Instance Attribute Details

#stderrObject (readonly)

Returns the value of attribute stderr


47
48
49
# File 'app/services/course/assessment/programming_evaluation_service.rb', line 47

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout


46
47
48
# File 'app/services/course/assessment/programming_evaluation_service.rb', line 46

def stdout
  @stdout
end

Instance Method Details

#to_hObject

Override to_h to provide a more detailed message in TrackableJob::Job#error


56
57
58
59
60
61
62
63
64
# File 'app/services/course/assessment/programming_evaluation_service.rb', line 56

def to_h
  {
    class: self.class.name,
    message: to_s,
    backtrace: backtrace,
    stdout: @stdout,
    stderr: @stderr
  }
end