fix hook error handling in .buildType()
Merge pull request #70 from eldargab/hook-error

fix hook error handling in .buildType()