Add @raise annotation to gem's method

Answered

Hi!

How do I tell to Rubymine that some external method throws an error?

 

Say I have such code:

user = User.find(id)
unless user
invalid!() # it's a method from Tzu gem that raises an error
end

puts user.address # <-- here Rubymine says that user can be nil
# But in the reality it cannot as there would be an error earlier.
2 comments
Comment actions Permalink

Hello,

at the moment it's not possible but it'd be great if you could submit a corresponding feature request on our tracker:

https://youtrack.jetbrains.com/issues/RUBY

1

Please sign in to leave a comment.