Add customError and further tests