Skip to content

Commit

Permalink
Fail gracefully if we get unparsable JSON
Browse files Browse the repository at this point in the history
We seem to sometimes not read enough bytes from the Sorbet output, which
ends up causing us to get an error from the JSON parser. While we
investigate and fix that root cause, we might as well gracefully handle
JSON parsing errors.
  • Loading branch information
paracycle committed May 13, 2022
1 parent c24f5ca commit 8750c75
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/tapioca/static/symbol_table_parser.rb
Expand Up @@ -16,6 +16,8 @@ def self.parse_json(json_string)
parser = SymbolTableParser.new
parser.parse_object(obj)
parser.symbols
rescue JSON::ParserError
Set.new
end

sig { returns(T::Set[String]) }
Expand Down

0 comments on commit 8750c75

Please sign in to comment.