Closed keien closed 10 years ago
I just found out that get()
doesn't even throw an exception when passed in an invalid ID - it just returns None
. This is actually quite convenient because we can just use if object
clauses to handle it instead of messily handling exceptions, so we could just not have these not-found errors.
What kind of views in our application would benefit from it?
Ignore my first comment...originally I was saying that instead of having to catch exceptions every time we use get()
, we could implement some global way to handle those exceptions. But then I found out that get()
doesn't actually throw an exception - it just returns None
. So we don't have to worry about it after all.
...could be used globally, don't you think? There will definitely be other views that would benefit from handling this kind of error.
We don't have global errors and exceptions yet, so these could be the first to go on there.