Merge pull request #169 from amarzavery/master

Provide the filename in error message that has an incorrect json.
This commit is contained in:
Amar Zavery 2017-09-25 14:46:49 -07:00 коммит произвёл GitHub
Родитель 8db0e92b5c a6c61dd203
Коммит b3ee14feed
4 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,6 @@
### 09/12/2017 0.4.13
- Provide the filepath of the file that has an incorrect json. This makes it easy for customers to find out the faulty file among numerous files.
### 09/12/2017 0.4.12
- [Model Validator] Should handle forward slashes in path parameters. #165
- [Model Validator] Should handle question mark in paths that are defined in x-ms-paths. #140

Просмотреть файл

@ -74,8 +74,10 @@ exports.parseJson = function parseJson(specPath) {
exports.docCache[specPath] = result;
return Promise.resolve(result);
} catch (err) {
log.error(err);
return Promise.reject(err);
let msg = `Unable to read the content or execute "JSON.parse()" on the content of file "${specPath}". The error is:\n${err}`;
let e = new Error(msg);
log.error(e);
return Promise.reject(e);
}
}
};

2
package-lock.json сгенерированный
Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "oav",
"version": "0.4.12",
"version": "0.4.13",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "oav",
"version": "0.4.12",
"version": "0.4.13",
"author": {
"name": "Microsoft Corporation",
"email": "azsdkteam@microsoft.com",