Improve exceptions by using errno.h