Fixed basic merge conflict
Added some basic error returning and created a new exception type