Skip to content

Commit 91cc6ed

Browse files
koumatsumotobrandonroberts
authored andcommitted
feat(schematics): display provided path when displaying an error (#1208)
Closes #1200
1 parent 35a4848 commit 91cc6ed

File tree

16 files changed

+23
-23
lines changed

16 files changed

+23
-23
lines changed

modules/effects/schematics-core/utility/find-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function findModuleFromOptions(
5757
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
5858
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
5959
} else {
60-
throw new Error('Specified module does not exist');
60+
throw new Error(`Specified module path ${modulePath} does not exist`);
6161
}
6262
}
6363
}

modules/effects/schematics-core/utility/ngrx-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
1616
const reducersPath = normalize(`/${options.path}/${options.reducers}`);
1717

1818
if (!host.exists(reducersPath)) {
19-
throw new Error('Specified reducers path does not exist');
19+
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
2020
}
2121

2222
const text = host.read(reducersPath);
@@ -192,7 +192,7 @@ export function addReducerImportToNgModule(options: any): Rule {
192192

193193
const modulePath = options.module;
194194
if (!host.exists(options.module)) {
195-
throw new Error('Specified module does not exist');
195+
throw new Error(`Specified module path ${modulePath} does not exist`);
196196
}
197197

198198
const text = host.read(modulePath);

modules/entity/schematics-core/utility/find-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function findModuleFromOptions(
5757
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
5858
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
5959
} else {
60-
throw new Error('Specified module does not exist');
60+
throw new Error(`Specified module path ${modulePath} does not exist`);
6161
}
6262
}
6363
}

modules/entity/schematics-core/utility/ngrx-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
1616
const reducersPath = normalize(`/${options.path}/${options.reducers}`);
1717

1818
if (!host.exists(reducersPath)) {
19-
throw new Error('Specified reducers path does not exist');
19+
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
2020
}
2121

2222
const text = host.read(reducersPath);
@@ -192,7 +192,7 @@ export function addReducerImportToNgModule(options: any): Rule {
192192

193193
const modulePath = options.module;
194194
if (!host.exists(options.module)) {
195-
throw new Error('Specified module does not exist');
195+
throw new Error(`Specified module path ${modulePath} does not exist`);
196196
}
197197

198198
const text = host.read(modulePath);

modules/router-store/schematics-core/utility/find-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function findModuleFromOptions(
5757
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
5858
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
5959
} else {
60-
throw new Error('Specified module does not exist');
60+
throw new Error(`Specified module path ${modulePath} does not exist`);
6161
}
6262
}
6363
}

modules/router-store/schematics-core/utility/ngrx-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
1616
const reducersPath = normalize(`/${options.path}/${options.reducers}`);
1717

1818
if (!host.exists(reducersPath)) {
19-
throw new Error('Specified reducers path does not exist');
19+
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
2020
}
2121

2222
const text = host.read(reducersPath);
@@ -192,7 +192,7 @@ export function addReducerImportToNgModule(options: any): Rule {
192192

193193
const modulePath = options.module;
194194
if (!host.exists(options.module)) {
195-
throw new Error('Specified module does not exist');
195+
throw new Error(`Specified module path ${modulePath} does not exist`);
196196
}
197197

198198
const text = host.read(modulePath);

modules/schematics-core/utility/find-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function findModuleFromOptions(
5757
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
5858
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
5959
} else {
60-
throw new Error('Specified module does not exist');
60+
throw new Error(`Specified module path ${modulePath} does not exist`);
6161
}
6262
}
6363
}

modules/schematics-core/utility/ngrx-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
1616
const reducersPath = normalize(`/${options.path}/${options.reducers}`);
1717

1818
if (!host.exists(reducersPath)) {
19-
throw new Error('Specified reducers path does not exist');
19+
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
2020
}
2121

2222
const text = host.read(reducersPath);
@@ -192,7 +192,7 @@ export function addReducerImportToNgModule(options: any): Rule {
192192

193193
const modulePath = options.module;
194194
if (!host.exists(options.module)) {
195-
throw new Error('Specified module does not exist');
195+
throw new Error(`Specified module path ${modulePath} does not exist`);
196196
}
197197

198198
const text = host.read(modulePath);

modules/schematics/schematics-core/utility/find-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function findModuleFromOptions(
5757
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
5858
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
5959
} else {
60-
throw new Error('Specified module does not exist');
60+
throw new Error(`Specified module path ${modulePath} does not exist`);
6161
}
6262
}
6363
}

modules/schematics/schematics-core/utility/ngrx-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
1616
const reducersPath = normalize(`/${options.path}/${options.reducers}`);
1717

1818
if (!host.exists(reducersPath)) {
19-
throw new Error('Specified reducers path does not exist');
19+
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
2020
}
2121

2222
const text = host.read(reducersPath);
@@ -192,7 +192,7 @@ export function addReducerImportToNgModule(options: any): Rule {
192192

193193
const modulePath = options.module;
194194
if (!host.exists(options.module)) {
195-
throw new Error('Specified module does not exist');
195+
throw new Error(`Specified module path ${modulePath} does not exist`);
196196
}
197197

198198
const text = host.read(modulePath);

0 commit comments

Comments
 (0)