Throw error when model is not configured for webservice
This commit is contained in:
parent
c6d7360f51
commit
d03dbfcb99
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue