Wrapped opening config/state files in try-except blocks.