Skip to content

Commit

Permalink
feat(schematics): display provided path when displaying an error (#1208)
Browse files Browse the repository at this point in the history
Closes #1200
  • Loading branch information
koumatsumoto authored and brandonroberts committed Jul 29, 2018
1 parent 35a4848 commit 91cc6ed
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion modules/effects/schematics-core/utility/find-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function findModuleFromOptions(
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
} else {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/effects/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
const reducersPath = normalize(`/${options.path}/${options.reducers}`);

if (!host.exists(reducersPath)) {
throw new Error('Specified reducers path does not exist');
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
}

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

const modulePath = options.module;
if (!host.exists(options.module)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
2 changes: 1 addition & 1 deletion modules/entity/schematics-core/utility/find-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function findModuleFromOptions(
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
} else {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/entity/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
const reducersPath = normalize(`/${options.path}/${options.reducers}`);

if (!host.exists(reducersPath)) {
throw new Error('Specified reducers path does not exist');
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
}

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

const modulePath = options.module;
if (!host.exists(options.module)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function findModuleFromOptions(
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
} else {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/router-store/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
const reducersPath = normalize(`/${options.path}/${options.reducers}`);

if (!host.exists(reducersPath)) {
throw new Error('Specified reducers path does not exist');
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
}

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

const modulePath = options.module;
if (!host.exists(options.module)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics-core/utility/find-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function findModuleFromOptions(
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
} else {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
const reducersPath = normalize(`/${options.path}/${options.reducers}`);

if (!host.exists(reducersPath)) {
throw new Error('Specified reducers path does not exist');
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
}

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

const modulePath = options.module;
if (!host.exists(options.module)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/schematics-core/utility/find-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function findModuleFromOptions(
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
} else {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/schematics/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
const reducersPath = normalize(`/${options.path}/${options.reducers}`);

if (!host.exists(reducersPath)) {
throw new Error('Specified reducers path does not exist');
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
}

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

const modulePath = options.module;
if (!host.exists(options.module)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/effect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function addImportToNgModule(options: EffectOptions): Rule {
}

if (!host.exists(modulePath)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function addImportToNgModule(options: StoreOptions): Rule {
}

if (!host.exists(modulePath)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function findModuleFromOptions(
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
} else {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/store-devtools/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
const reducersPath = normalize(`/${options.path}/${options.reducers}`);

if (!host.exists(reducersPath)) {
throw new Error('Specified reducers path does not exist');
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
}

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

const modulePath = options.module;
if (!host.exists(options.module)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down
2 changes: 1 addition & 1 deletion modules/store/schematics-core/utility/find-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function findModuleFromOptions(
} else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return normalize(modulePath + '/' + moduleBaseName + '.module.ts');
} else {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/store/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function addReducerToState(options: any): Rule {
const reducersPath = normalize(`/${options.path}/${options.reducers}`);

if (!host.exists(reducersPath)) {
throw new Error('Specified reducers path does not exist');
throw new Error(`Specified reducers path ${reducersPath} does not exist`);
}

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

const modulePath = options.module;
if (!host.exists(options.module)) {
throw new Error('Specified module does not exist');
throw new Error(`Specified module path ${modulePath} does not exist`);
}

const text = host.read(modulePath);
Expand Down

0 comments on commit 91cc6ed

Please sign in to comment.