Throw error when model is not configured for webservice

This commit is contained in:
Anatoliy Chakkaev 2013-01-23 03:22:31 +07:00
parent c6d7360f51
commit d03dbfcb99
1 changed files with 3 additions and 1 deletions

View File

@ -15,7 +15,9 @@ WebService.prototype.define = function defineModel(descr) {
};
WebService.prototype.getResourceUrl = function getResourceUrl(model) {
return this._models[model].settings.restPath;
var url = this._models[model].settings.restPath;
if (!url) throw new Error('Resource url (restPath) for ' + model + ' is not defined');
return url;
};
WebService.prototype.getBlankReq = function () {