error handling best practices

sure, this is just funny code without any quality control :)