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