zazoomauro / node-dependency-injection

The NodeDependencyInjection component allows you to standarize and centralize the way objects are constructed in your application.
https://github.com/zazoomauro/node-dependency-injection/wiki
MIT License
281 stars 34 forks source link

Syntax error in yaml file throws serviceFileNotFoundException2 (while service file was found) #90

Closed avdg closed 6 years ago

avdg commented 6 years ago

Steps to reproduce:

What happens:

node_modules/node-dependency-injection/dist/lib/Loader/YamlFileLoader.js:61
        throw new _ServiceFileNotFoundException2.default(this.filePath);
        ^

What is expected

A syntax error for the involved yaml file

The problem is that in the code of the link below is always assuming the file was not found when an error is thrown and nothing from the actual exception object is displayed with the error.

This could show errors like

YAMLException: bad indentation of a sequence entry at line 5, column 15:

Involved code

https://github.com/zazoomauro/node-dependency-injection/blob/c478bd3f7130285cafa5d0b40d307fc7452268fc/lib/Loader/YamlFileLoader.js#L15-L19