try-catch for PDO, write the config