Module: RailsTwirp::Errors

Included in:
Base
Defined in:
lib/rails_twirp/errors.rb

Instance Method Summary collapse

Instance Method Details

#error(code, message, meta = nil) ⇒ Object

Helper that sets the response to a Twirp Error The valid error codes can be found in Twirp::ERROR_CODES



9
10
11
# File 'lib/rails_twirp/errors.rb', line 9

def error(code, message, meta = nil)
  self.response_body = Twirp::Error.new(code, message, meta)
end