Ruby on Rails Monday, June 27, 2016

I'd like to catch any RoR exceptions in REST API application with 'rescue_from'.


rescue_from
StandardError do |exception| message = Rails.env.production? ? 'API server error' : exception.message render json: {status: "Error", message: message}, status: :internal_server_error end


but it catches too much irrelevant exceptions. Can I catch RoR exceptions only? Is it a good practice at all? If not, what else you can recommend?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3552a5a5-0bb7-424e-ac75-f8d4c9771198%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Excellent video for getting people started with import/export. This
should have a part two with more complex cases. Let me know if you
want to pair on it.

On Mon, Jun 27, 2016 at 6:45 AM, Dave Kimura <lists@ruby-forum.com> wrote:
> https://www.driftingruby.com/episodes/importing-and-exporting-csv-data
>
> Basics on importing and exporting CSV Data using Ruby and without gems.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cbdeae935967150b67faab3130faa69f%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAP4w2POsf%3Dvoot60aJthNnsMWsZGaZ0QRbnxtXmaQrjeD9nN3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

https://www.driftingruby.com/episodes/importing-and-exporting-csv-data

Basics on importing and exporting CSV Data using Ruby and without gems.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cbdeae935967150b67faab3130faa69f%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.