Implement function error

Implemented error() in errors.c and the declaration of error() in errors.h