ruby - TypeError (class or module required for rescue clause) -
i've been using stripe on year now, based on ryan bates's railscast episode found here. however, error handling has stopped working, , i've never seen error before. began running app on ruby 2.1, , near can tell, that's problem.
this instance method in subscription
model:
begin save_with_stripe_payment rescue stripe::invalidrequesterror => e logger.error "stripe error while creating customer: #{e.message}" logger.error e.backtrace.join("\n") errors.add :base, "there problem card." false rescue e logger.error e.message logger.error e.backtrace.join("\n") errors.add :base, e.message false end
the line:
rescue stripe::invalidrequesterror => e
is 1 throwing error. stacktrace there goes "begin" line, , that's it. missing here?
the line number in error little misleading, error coming this:
rescue e
i think meant
rescue => e
ruby ruby-2.1
No comments:
Post a Comment