I want to make an error with ruby.

Asked 2 years ago, Updated 2 years ago, 37 views

I'd like to make an error with ruby for certain results. What should I do in this case?

For example, when json is retrieved by hitting webapi, an error is returned if the item error exists.

ruby-on-rails ruby

2022-09-30 18:41

2 Answers

Can't I throw exceptions with Kernel.#raise or ?


2022-09-30 18:41

raise StandardError, "Error Contents"


2022-09-30 18:41

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.