Better logging of errors.
This commit is contained in:
		@@ -58,13 +58,13 @@ export function activate(context: vscode.ExtensionContext) {
 | 
			
		||||
                try {
 | 
			
		||||
                    let json = JSON.parse(outputBuffer);
 | 
			
		||||
 | 
			
		||||
                    console.log(json);
 | 
			
		||||
 | 
			
		||||
                    const diagnostics = [];
 | 
			
		||||
                    let cd = json['columnDefinitions']
 | 
			
		||||
 | 
			
		||||
                    if (!json['rows']) {
 | 
			
		||||
                        if (!json['userErrors']) {
 | 
			
		||||
                            myOutputChannel.append("SQL executed successfully.\n");
 | 
			
		||||
                        } else {
 | 
			
		||||
                        if (json['userErrors']) {
 | 
			
		||||
                            myOutputChannel.append("Errors found:\n");
 | 
			
		||||
 | 
			
		||||
                            const document = vscode.window.activeTextEditor.document;
 | 
			
		||||
@@ -79,6 +79,10 @@ export function activate(context: vscode.ExtensionContext) {
 | 
			
		||||
                            }
 | 
			
		||||
 | 
			
		||||
                            diagnosticCollection.set(document.uri, diagnostics);
 | 
			
		||||
                        } else if (json['exception']) {
 | 
			
		||||
                            myOutputChannel.append("Exception caught: " + json['exceptionMessage'] + "\n");
 | 
			
		||||
                        } else {
 | 
			
		||||
                            myOutputChannel.append("SQL executed successfully.\n");
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        provider.setData(json);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user