If the file is invalid json then this raises ValueError. It would be good to handle this too.