Providing more information about incorrect widget retrieving by name

Started by GetterSetter, 07 April 2024, 17:03:41

cg923

Quote from: GetterSetter on 09 April 2024, 19:44:32
Quote from: cg923 on 09 April 2024, 19:31:13doesn't your original problem disappear
Actually, it doesn't. If get() throws the exception that isn't caught, the program will terminate and in the terminal I will be able to see what happened (what was the reason to terminate) whereas a nullptr dereference will cause a segfault without any explanation.


Ahh. Gotcha. Now I'm on the same page. I suppose my only reservation toward throwing an error there (I know Texus has already decided) is that I can imagine a case where returning nullptr is useful, and having an error get thrown there means one would need to catch that error and deal with it... which would be a simple rewrite of existing code but could be a breaking change. Wouldn't be the end of the world.