te25son / Jokes

CLI app for jokes
0 stars 0 forks source link

Safer joke to string #4

Closed te25son closed 2 years ago

te25son commented 2 years ago

The __repr__ method in Joke was calling unwrap internally, which is fine since we're calling it within a @safe method. However, what happens if we don't call it within a safe method? It throws an unwrap exception if the inner joke doesn't exist. This is unlikely to happen, but can happen.