Rebuilt removed error function

have errors caught directly by try catch statements