From b079e3571afe7ae2e7bf498e74250024cfcc82a5 Mon Sep 17 00:00:00 2001
From: SeeBasTStick <sebastian.stock@hhu.de>
Date: Wed, 10 Jun 2020 17:00:32 +0200
Subject: [PATCH] improved feedback for errors in the json. Will now display
 the line also

---
 README.md                  |  2 +-
 server/src/errorHandler.ts | 13 +++++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index e0f026c..9e71085 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ Please note that user settings overwrite workspace settings.
 - Linter Support (via Server, is still in development by Mircosoft https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/)
 - Quickfix support aká Code Completion
 - Add feedback of failing prob cli to output
-
+- Switch to Java Server
 
 ## Release Notes
 
diff --git a/server/src/errorHandler.ts b/server/src/errorHandler.ts
index 5d99afc..7e4d0fb 100644
--- a/server/src/errorHandler.ts
+++ b/server/src/errorHandler.ts
@@ -19,10 +19,19 @@ export async function readErrors(errorPath: string): Promise<Map<string, Set<NDJ
 		crlfDelay: Infinity
 	});
 
-	for await (const line of rl) {
 
-		let obj: NDJSON = JSON.parse(line)
+	let i : number = 1
+	for await (const line of rl) {
 
+		let obj: NDJSON 
+		
+		try{
+			console.log(line)
+			 obj = JSON.parse(line)
+		}catch(e){
+			throw Error(e.message + " at line " + line)
+		}
+		i++
 		let path: string = obj.details.file
 
 
-- 
GitLab