mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
refine error message
This commit is contained in:
@@ -697,9 +697,11 @@ var Node = cc.Class({
|
||||
var originCount = this._components.length;
|
||||
for (var c = 0; c < originCount; ++c) {
|
||||
var component = this._components[c];
|
||||
if (! (component instanceof cc.Component) && CC_EDITOR) {
|
||||
cc.error('Sorry, the component of "%s" which with an index of %s is corrupted! It has been removed.\nSee DevTools for details.', this.name, c);
|
||||
console.log('Corrupted component value:', component);
|
||||
if ( !(component instanceof cc.Component) ) {
|
||||
if (CC_EDITOR) {
|
||||
cc.error('Sorry, the component of "%s" which with an index of %s is corrupted! It has been removed.', this.name, c);
|
||||
console.log('Corrupted component value:', component);
|
||||
}
|
||||
if (component) {
|
||||
this._removeComponent(component);
|
||||
}
|
||||
|
||||
@@ -404,9 +404,15 @@ var _Deserializer = (function () {
|
||||
|
||||
// Type Object (including CCClass)
|
||||
|
||||
klass = self._classFinder(serialized.__type__);
|
||||
var type = serialized.__type__;
|
||||
klass = self._classFinder(type);
|
||||
if (!klass) {
|
||||
cc.error('[cc.deserialize] unknown type: ' + serialized.__type__);
|
||||
if (CC_EDITOR && Editor.UuidUtils.isUuid(type)) {
|
||||
type = Editor.UuidUtils.decompressUuid(type);
|
||||
cc.warn('Can not find script "%s"', type);
|
||||
return null;
|
||||
}
|
||||
cc.warn('Can not find class "%s"', type);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user