Adding loggers and better error messages