```javascript
if(!result.success) {
    throw Exception("Failed because: " + result.reason);
}
```

Will give you better debug info when an error does happen.