Skip to content

Commit

Permalink
Merge pull request #2804 from koic/add_error_handling_for_missing_par…
Browse files Browse the repository at this point in the history
…ser_gem

Add error handling for missing `parser` gem in `Prism::Translation`
  • Loading branch information
kddnewton authored May 13, 2024
2 parents fcbeb50 + 4880aec commit cc6d465
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/prism/translation/parser.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# frozen_string_literal: true

require "parser"
begin
require "parser"
rescue LoadError => e
warn 'Error: Unable to load parser. Add `gem "parser"` to your Gemfile.'
exit!
end

module Prism
module Translation
Expand Down

0 comments on commit cc6d465

Please sign in to comment.