add simple check for yaml parse error

When using figaro, a simple syntax error in my config/application.yml file caused bugs in the flatten method and it took a while to figure out why (YAML converts improper files to strings apparently). Throwing an exception here would be nice to alert the user that something's wrong with their yml file.