Changed some errors to use the CustomErrorException instead of a generic one.