Closed ZorGleH closed 9 years ago
That's right, gotta add a more specific error message...
Also, just for information, you can use properties that do not exist yet using the proto
attribute, as following:
domino.struct.add({
id: 'ZorGleH',
proto: ['unknownStruct'],
struct: {
errMsgNazi: 'unknownStruct'
}
});
// Then, declare the "unknownStruct" structure:
domino.struct.add({
id: 'unknownStruct',
struct: {
myAttr: 'number'
}
});
"errMsgNazi
" T_T just trying to make the world better! Oops! Sounds even worse!
Thanks for the "proto" trick ;)
When you declare a new structure, if it embeds a structure that doesn't exist, you got the message:
[domino.global] A structure requires a valid "structure" property describing the structure. It can be a valid structure or a function that test if an object matches the structure.
The stack trace gives you the line of the structure declaration, but it could be useful to know the key and structure involved.e.g.:
In this case, you'd like to know that the key which causes error is
cruiseMode
and the struct is'unknownStruct'
, especially if you've got several complex structs.