You're certainly entitled to do it your own way, but modern programming practice is moving away from return codes to indicate errors and toward exceptions. You can see this in most recent books and in the prominent place exceptions have in recently designed languages.