From 9a5d67180150384bad38be48034694ef55e52da5 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 2 Aug 2023 12:12:58 +0700 Subject: [PATCH] chore(developer): add Error_NotAProjectFile --- developer/src/kmc/src/messages/messages.ts | 4 ++++ developer/src/kmc/src/util/projectLoader.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/developer/src/kmc/src/messages/messages.ts b/developer/src/kmc/src/messages/messages.ts index f2217471d7..95c2e73741 100644 --- a/developer/src/kmc/src/messages/messages.ts +++ b/developer/src/kmc/src/messages/messages.ts @@ -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; } diff --git a/developer/src/kmc/src/util/projectLoader.ts b/developer/src/kmc/src/util/projectLoader.ts index bf291f9dce..e92a84c399 100644 --- a/developer/src/kmc/src/util/projectLoader.ts +++ b/developer/src/kmc/src/util/projectLoader.ts @@ -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; }