Reflect changes from shinnn/fix-type-error-handling