Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Webpack::Rails::Manifest.load_dev_server_manifest wildcard exception handler #86

Open
diclophis opened this issue May 17, 2017 · 1 comment

Comments

@diclophis
Copy link

I would like to submit as an issue the fact that the load_dev_server_manifest class method uses a "wildcard" exception handling block ... i.e.

    def load_dev_server_manifest
      host = ::Rails.configuration.webpack.dev_server.manifest_host
      port = ::Rails.configuration.webpack.dev_server.manifest_port
      http = Net::HTTP.new(host, port)
      http.use_ssl = ::Rails.configuration.webpack.dev_server.https
      http.verify_mode = ::Rails.configuration.webpack.dev_server.https_verify_peer ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
      http.get(dev_server_path).body
    rescue => e
      raise ManifestLoadError.new("Could not load manifest from webpack-dev-server at http://#{host}:#{port}#{dev_server_path} - is it running, and is stats-webpack-plugin loaded?", e)
    end

This is highly undesirable due to the fact that any exception in an early before_filter gets caught in this handler, and hides the true exception from the developer!

@mipearson
Copy link
Owner

Correct - it should be limiting itself to the Net::HTTP exceptions.

I'd welcome a pull request to fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants