2017-12-20 16:27:18 -05:00
|
|
|
var applyErrorPrototype = require("./applyErrorPrototype");
|
|
|
|
|
|
2015-09-11 10:40:00 -07:00
|
|
|
/**
|
|
|
|
|
* When a bound model attempts to retrieve JSONGraph it should throw an
|
|
|
|
|
* error.
|
|
|
|
|
*
|
|
|
|
|
* @private
|
|
|
|
|
*/
|
|
|
|
|
function BoundJSONGraphModelError() {
|
2017-12-20 16:27:18 -05:00
|
|
|
var instance = new Error("It is not legal to use the JSON Graph " +
|
|
|
|
|
"format from a bound Model. JSON Graph format" +
|
|
|
|
|
" can only be used from a root model.");
|
|
|
|
|
|
|
|
|
|
instance.name = "BoundJSONGraphModelError";
|
|
|
|
|
|
|
|
|
|
if (Object.setPrototypeOf) {
|
|
|
|
|
Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Error.captureStackTrace) {
|
|
|
|
|
Error.captureStackTrace(instance, BoundJSONGraphModelError);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return instance;
|
2015-09-11 10:40:00 -07:00
|
|
|
}
|
|
|
|
|
|
2017-12-20 16:27:18 -05:00
|
|
|
applyErrorPrototype(BoundJSONGraphModelError);
|
2015-09-11 10:40:00 -07:00
|
|
|
|
|
|
|
|
module.exports = BoundJSONGraphModelError;
|