Use
raise
instead offail
to rethrow exceptions
This means if you catch an error that’s been thrown by an external gem/library then you can choose to re-throw it as a different exception (i.e. your own Exception error, named specifically relevant to your application)
Use
fail
instead ofraise
to signal exceptions
This means if you catch an error that’s been thrown by your own code (e.g. you’ve raised a custom error/exception), then this means you don’t intend to re-throw the exception as something else, you’ll instead deal with that exact exception now