Nit: append semicolon.

Also, since error is always set before being used, you don't need to initialize it, so it's preferable to simply declare it, since that is simpler, and it also means that you never change its type (from object to string).