Closed elifoster closed 8 years ago
(See #42).
We have a couple options I've thought of:
Categorized errors with a description given in the constructor:
# We have determined that the edit has errored:
fail EditError.new(error_message)
Specifically defined errors
# We have determined that the edit has errored
case error_message
when 'badtoken'
fail BadToken.new
# ...
end
The benefits to the first:
The benefits to the second:
@APerson241 @xbony2
(For the record, I strongly support the first one, for the reason you mentioned.)
@elifoster and @xbony2, what are your opinions on option 1 vs option 2?
Whatever work.
I like option 1
I've implemented option 1 (for just edit()
) in #42.
I have finally finished this up.
Right now, if there's an error, we simply return the error code as a String. This makes it difficult or weird to check for errors. For example, we want to be able to do this, as is idiomatic in Ruby:
but right now, we have to do this:
or this, for methods that return a String either way
This is awful.