Exception: Projects::Pexception::ProjectsException

Inherits:
Exception
  • Object
show all
Defined in:
lib/projects/exception/ProjectsException.rb

Overview

  • ProjectsException is used to throw a new projects exception with code and message.

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ ProjectsException

  • Construct a new ProjectsException by passing an error code and error message.

Parameters

  • code
    • Error code.

  • message
    • Error message.



22
23
24
25
26
# File 'lib/projects/exception/ProjectsException.rb', line 22

def initialize(code, message)
  super(message)
  @code = code   
  @message = message
end

Instance Method Details

#getCodeObject

  • get the error code.

Returns

  • Error code.



34
35
36
# File 'lib/projects/exception/ProjectsException.rb', line 34

def getCode
  return @code
end

#getMessageObject

  • get the error message.

Returns

  • Error message.



44
45
46
# File 'lib/projects/exception/ProjectsException.rb', line 44

def getMessage
  return @message
end