Fix more fatal errors when using FFP
commitf1ce30f5bedce068f083af0b2a3dfec3ed4f8c0b
authorFangyi Zhou <fangyizhou@fb.com>
Mon, 11 Jun 2018 10:19:03 +0000 (11 03:19 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 11 Jun 2018 16:29:49 +0000 (11 09:29 -0700)
tree5639b6c4eba22c3de245e69afebb1d3030a941be
parentec602cce247f55ee83ba05da47cb5a9c11d3a52a
Fix more fatal errors when using FFP

Summary:
- Replace usages of `raise` with `raise_parsing_error`
- Fix in naming: catch potential exceptions thrown by `String.sub`

These two changes prevent fatal errors to be thrown when we run `hh_single_type_check` on certain files with errors when using the FFP. We would like to report the errors instead of crashing to indicate a user error occurred.

Reviewed By: CatherineGasnier

Differential Revision: D8253357

fbshipit-source-id: 97b9f14445a7bb248da32e22d112a041dd69c34c
hphp/hack/src/naming/naming.ml
hphp/hack/src/parser/full_fidelity_ast.ml