Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't swallow YAML parse errors #331

Closed
JanStevens opened this issue Aug 24, 2016 · 2 comments
Closed

Don't swallow YAML parse errors #331

JanStevens opened this issue Aug 24, 2016 · 2 comments

Comments

@JanStevens
Copy link
Contributor

JanStevens commented Aug 24, 2016

Hello,

If the YAML file cannot be parsed correctly (for whatever reason) AssetSync should just fail and die. We wasted a day on a type just to find out that AssetSync swallows any errors.

    def yml
      begin
        @yml ||= YAML.load(ERB.new(IO.read(yml_path)).result)[Rails.env] rescue nil || {}
      rescue Psych::SyntaxError
        @yml = {}
      end
    end

But after finding it it worked! (still happy camper)

Regards,

@PikachuEXE
Copy link
Member

I find this commit only (with Blame)
06af52e
Not sure what's the reason of that change

Also already got #270 that proposed to NOT rescue the error
But I think I will create another PR to raise custom error with better error message

@PikachuEXE
Copy link
Member

Fixed in e0084a2

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

No branches or pull requests

2 participants