I have issue by using try catch handle error

18 views
Skip to first unread message

chen y

unread,
Aug 24, 2016, 1:58:16 AM8/24/16
to Neo4j
 using (var driver = GraphDatabase.Driver("bolt://localhost", AuthTokens.Basic("neo4j", "neo4j")))

            using (var session = driver.Session())
            {

                foreach (string element in Array)
                {
                   
                   
                    try
                    {
                        if (element == "")
                        { 
                        
                        }

                        else
                        {  
                            session.Run(element);
                        }
                    }

                    catch (Exception ex)
                    {

                        throw ex;


                    }

                }


this is my code, and when one statement is wrong in the list,  it will keep return error even my next statement is right in the list. I wonder how can i figure it out ?

chen y

unread,
Aug 26, 2016, 10:48:27 AM8/26/16
to Neo4j
so the element is the cypher statement. Once the cypher statement is wrong and the rest of element keep sending error.
Reply all
Reply to author
Forward
0 new messages