Use cc.errorID instead of console.error

This commit is contained in:
pandamicro
2017-12-14 17:54:42 +08:00
parent 31686bbfd0
commit 950fd4e41d
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -621,6 +621,10 @@ if (CC_DEBUG) {
"8301": "Camera does not support Canvas Mode.", //cc.Camera.enabled
// AudioEngine: 8400
"8400": "Wrong type arguments, 'filePath' must be a String.", // cc.audioEngine.play
// New Renderer 10000
"9000": "Stencil manager does not support level bigger than %d in this device.",
"9001": "Stencil manager is already empty, cannot pop any mask",
};
cc._LogInfos = logs;
}
+2 -2
View File
@@ -89,7 +89,7 @@ StencilManager.prototype = {
pushMask (mask) {
if (this._maskStack.length + 1 > this._maxLevel) {
console.error(`Stencil manager does not support level bigger than ${this._maxLevel} in this device.`);
cc.errorID(9000, this._maxLevel);
}
this._maskStack.push(mask);
this.stage = Stage.ENTER_LEVEL;
@@ -97,7 +97,7 @@ StencilManager.prototype = {
popMask () {
if (this._maskStack.length === 0) {
console.error(`Stencil manager is already empty, cannot pop any mask`);
cc.errorID(9001);
}
this._maskStack.pop();
this.stage = Stage.EXIT_LEVEL;