Implemented error handling function for non-development environments

As I filled this TODO item in my project based on this seed (thanks), I thought it may be usefull to share it. :)