Call error handler if it is defined