Assignment #2#8
Conversation
lib/api.rb
Outdated
There was a problem hiding this comment.
Here you're returning a string that has a semantic meaning of "nothing was found". So this method could either return:
- string with "Not Found"
- Movie object with information
I think either raising an exception, or a specific NilMovie would be more expressive of what happened.
|
Left you a suggestion on how you're handling the not-found... looks promising! Let me know if you have questions on the string vs object stuff. |
|
@jwo Jesse, I've updated the way I raise the exception. I think this looks better, right? |
|
@annavester I think it's better for sure. I would recommend that instead of catching the NotMethodError, we try to catch something a little more close to the domain. maybe something like this: Now, the API will raise a MovieNotFoundError, and you can catch it in the movie_json workflow and handle it there. Maybe: |
Here is my Panda Level, I am still working on the rest... Thanks!