Skip to content

Commit 583a85b

Browse files
committed
improve log messages
1 parent ffcaa26 commit 583a85b

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ function addProperties(model, Class, classId) {
914914
this.constructor.name,
915915
propertyName,
916916
position,
917-
propertyType
917+
propertyType[0]
918918
);
919919
}
920920
} else {
@@ -1301,7 +1301,7 @@ function addStructure(path, name, model, id) {
13011301
this.constructor.name,
13021302
propertyName,
13031303
position,
1304-
propertyType
1304+
propertyType[0]
13051305
);
13061306
}
13071307
} else {

src/log.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ exports.invalidPropertyType = function invalidPropertyType(
153153
? property.constructor.name
154154
: typeof property;
155155
getLogger().warn(
156-
"invalid type for property '" +
156+
"invalid value for property '" +
157157
propertyName +
158158
"': expected type '" +
159159
type +
@@ -297,27 +297,27 @@ exports.invalidPropertyName = function invalidPropertyName(
297297
: typeof propertyValue;
298298

299299
getLogger().warn(
300-
"invalid type for property '" +
300+
"invalid value for property '" +
301301
propertyName +
302302
"' on component '" +
303303
id +
304304
"'" +
305305
classInfo +
306-
": expected '" +
306+
": expected type '" +
307307
type +
308-
"' instead of '" +
308+
"' instead of type '" +
309309
realType +
310310
"'"
311311
);
312312
} else {
313313
realType = type && type.constructor ? type.constructor.name : typeof type;
314314

315315
getLogger().warn(
316-
"invalid type for property type '" +
316+
"invalid value for property '" +
317317
propertyName +
318318
"' on component '" +
319319
classInfo +
320-
": expected 'string' instead of '" +
320+
": expected type 'string' instead of type '" +
321321
realType +
322322
"'"
323323
);
@@ -654,11 +654,11 @@ exports.invalidType = function invalidType(name, value, typeName) {
654654
name && value.constructor ? value.constructor.name : typeof value;
655655

656656
getLogger().warn(
657-
"invalid type for property '" +
657+
"invalid value for property '" +
658658
name +
659-
"': expected '" +
659+
"': expected type '" +
660660
typeName +
661-
"' instead of '" +
661+
"' instead of type '" +
662662
realType +
663663
"'"
664664
);

src/metamodel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,8 @@ function getClassName(obj) {
997997

998998
if (obj && obj.constructor) {
999999
result = obj.constructor.name;
1000+
} else {
1001+
result = typeof obj;
10001002
}
10011003
return result;
10021004
}

0 commit comments

Comments
 (0)