Move error hooks into catch block
Move error hooks into catch block

This allows error hooks to halt execution.

karimmtarek/pakyow,jphager2/pakyow,jphager2/pakyow,karimmtarek/pakyow,karimmtarek/pakyow,jphager2/pakyow