[SEMVER-MAJOR] throw error for undefined mixin#944
Conversation
c8f4246 to
b1285ce
Compare
|
@bajtos, please review. thanks |
|
@alexpit, don't forget to update the release notes! |
| modelClass.mixin(model, options); | ||
| } else { | ||
| debug('Invalid mixin: %s', name); | ||
| throw new Error('Invalid mixin: ' + name); |
There was a problem hiding this comment.
Please include the model name in the error message, otherwise it's impossible to find the model which is referencing this missing mixing.
I would also reword the message a bit, e.g.
'Model ' + modelClass.modelName + ' uses unknown mixin ' + name|
@alexpit thank you for the pull request, you are headed in the right direction! I left few comments to address, see above. |
|
@richardpringle, please review. thx |
|
@bajtos, please review addressed comments. thx |
| silently ignored. This has been fixed in 3.0, therefore an undefined mixin | ||
| applied to a LoopBack model will throw an error that needs to be handled. | ||
|
|
||
| Please see [related code change](https://github.com/strongloop/loopback-datasource-juggler/pull/944) No newline at end of file |
There was a problem hiding this comment.
Nit pick:
Please see [related code change]() for details.
| var model = this.modelBuilder.getModel(name); | ||
| if (model) { | ||
| debug('Mixin is resolved to a model: %s', name); | ||
| debug('Mixin "' + name + '" resolves to model: %s', modelClass.modelName); |
There was a problem hiding this comment.
This is not correct. Mixin "name" is resolved to a model called "name" in this branch, and then it is applied to another model called "modelClass.modelName".
It's better to avoid making unrelated code changes, as it makes code archaeology more difficult.
Please revert this line.
|
@bajtos, please review addressed comments. thx |
|
LGTM 👏 Please squash the commits before landing, the commands are |
|
@bajtos Does Alex need to backprot this change? @alexpit For Thanks :-) |
I believe Miroslav meant run |
|
I believe that depends on your push policy configuration. It's safer to explicitly push a certain branch with '+' causing the force push. |
No, we cannot back-port breaking changes.
Interesting. I think it's rather unlikely that one would one end up with a feature branch configured to be pushed to a long-lived remote branch like BTW in some repositories, we have locked long-lived branches like |
|
@slnode test please |
3547299 to
e0e31ca
Compare
|
@bajtos please review |
@alexpit could you please rebase on top of the current master? |
|
@slnode test please |
e0e31ca to
423db34
Compare
connect to #566