What about if there is a syntax error?
Adding a new device will catch both a KeyError and a SyntaxError.