Sometimes functions fail to do what they say they do. When this happens, some functions throw an exception (e.g. PDO constructor) and others just return (e.g. mysql_connect
would return false
).
I have many times had to choose between one of these approaches over the other and I wonder if there is a design principle that deals with this.