added better exception handling and fixed command line parameters
added better exception handling and fixed command line parameters

kkdang/synapsePythonClient,thomasyu888/synapsePythonClient,zimingd/synapsePythonClient,larssono/synapsePythonClient