Fixed issue #115 - Added more detailed error handling to client-side syn...

...c states
Can you move this up to line 232? It would look like:

```javascript
if {

} else {

}
```