Skip to content

Commit

Permalink
feat: improved error message for to long models
Browse files Browse the repository at this point in the history
  • Loading branch information
st-vi committed Jan 12, 2024
1 parent 234d4da commit b9e04c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WebSocketClient/src/ImportExportFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function uploadFile(): Promise<string> {
stringPromise.then((res) => {
const lineCount = res.split('\n').length;
if(lineCount > config.MAX_NUMBER_LINES){
displayEditorErrorAtContent(`The Editor only allows content up to ${config.MAX_NUMBER_LINES} Lines!`);
displayEditorErrorAtContent(`The Editor only allows content up to ${config.MAX_NUMBER_LINES} Lines! (Because of performance reasons)`);
resolve(res.split('\n').slice(0, config.MAX_NUMBER_LINES - 1).reduce((acc, curr) => acc + curr + "\n", ""));
}else{
resolve(res);
Expand Down
4 changes: 2 additions & 2 deletions WebSocketClient/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,14 @@ export const startUvlClient = async () => {
} else {
vscode.commands.executeCommand("deleteLeft");
}
displayEditorErrorAtContent(`The Editor only allows content up to ${config.MAX_NUMBER_LINES} Lines!`);
displayEditorErrorAtContent(`The Editor only allows content up to ${config.MAX_NUMBER_LINES} Lines! (Because of performance reasons)`);
} else if (numberCharacters > config.MAX_NUMBER_CHARACTERS) {
if (numberCharacters > config.MAX_NUMBER_CHARACTERS + 1) {
vscode.commands.executeCommand("undo");
} else {
vscode.commands.executeCommand("deleteLeft");
}
displayEditorErrorAtContent(`The Editor only allows content up to ${config.MAX_NUMBER_CHARACTERS} Characters!`);
displayEditorErrorAtContent(`The Editor only allows content up to ${config.MAX_NUMBER_CHARACTERS} Characters! (Because of performance reasons)`);
}
debouncedSave();
if (updateGraph && debounceGenGraph !== undefined) {
Expand Down

0 comments on commit b9e04c8

Please sign in to comment.