Merge pull request #9395 from keymanapp/chore/developer/9394-not-a-project-file

chore(developer): add Error_NotAProjectFile 🗜
This commit is contained in:
Marc Durdin 2023-08-03 11:01:43 +10:00 committed by GitHub
commit 166e0ca992
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -68,5 +68,9 @@ export class InfrastructureMessages {
static Error_FileTypeNotFound = (o:{ext:string}) => m(this.ERROR_FileTypeNotFound,
`A file of type ${o.ext} was not found in the project.`);
static ERROR_FileTypeNotFound = SevError | 0x000E;
static Error_NotAProjectFile = (o:{filename:string}) => m(this.ERROR_NotAProjectFile,
`File ${o.filename} must have a .kpj extension to be treated as a project.`);
static ERROR_NotAProjectFile = SevError | 0x000F;
}

View file

@ -23,7 +23,7 @@ export function loadProject(infile: string, callbacks: CompilerCallbacks) {
// infile should be the .kpj
if(!infile.endsWith(KeymanFileTypes.Source.Project)) {
// TODO separate error code
callbacks.reportMessage(InfrastructureMessages.Error_InvalidProjectFile({message: 'file should have .kpj extension'}));
callbacks.reportMessage(InfrastructureMessages.Error_NotAProjectFile({filename:infile}));
return null;
}