Exception: UuAppstudio::Error

Inherits:
StandardError
  • Object
show all
Defined in:
app/helpers/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code, message, cause = nil) ⇒ Error

Returns a new instance of Error



7
8
9
10
11
# File 'app/helpers/error.rb', line 7

def initialize( error_code, message, cause=nil )
  super( message )
  @error_code = error_code
  @cause = cause
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause



6
7
8
# File 'app/helpers/error.rb', line 6

def cause
  @cause
end

#error_codeObject (readonly)

Returns the value of attribute error_code



6
7
8
# File 'app/helpers/error.rb', line 6

def error_code
  @error_code
end

Instance Method Details

#to_jsonObject



13
14
15
# File 'app/helpers/error.rb', line 13

def to_json(*)
  {message: message, code: @error_code}.to_json
end