expose error factory