Adding error handler for compilations