Catch errors throw in synchronous execution

I'd actually like to add promise support on top of this as well.