Updated errors to export as module functions