Skip to content

Commit 3067a2d

Browse files
committed
Fix runtime error, add documentation for debugging.
1 parent 3f529c6 commit 3067a2d

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,32 @@ To stop the sample:
7373

7474
The sample are running the sample in foreground, logging and tracing from both client and server components are on stdout of the command window, to stop the sample, press Ctl C, which will terminate both the client and server components.
7575

76+
Debugging server component
77+
--------------------------
78+
Node remote debugging is enabled on port 9229 for server in docker compose, developer can attach to server from IDE e.g. vscode.
79+
80+
To set up the run config to debug in vscode, add below contents to `.vscode/launch.json`
81+
```
82+
{
83+
// Use IntelliSense to learn about possible attributes.
84+
// Hover to view descriptions of existing attributes.
85+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
86+
"version": "0.2.0",
87+
"configurations": [
88+
{
89+
"address": "0.0.0.0",
90+
"localRoot": "${workspaceFolder}/server",
91+
"name": "Attach to Remote",
92+
"port": 9229,
93+
"remoteRoot": "/server",
94+
"request": "attach",
95+
"skipFiles": ["<node_internals>/**"],
96+
"type": "node"
97+
}
98+
]
99+
}
100+
```
101+
76102
## Error Responses and handling:
77103

78104
[See ErrorResponses.md](./ErrorResponses.md)

server/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function loadDataFile(dataset_name: string, resource_file_name: string): any {
113113
try {
114114
return JSON.parse(resource);
115115
} catch (error) {
116-
process.stdout.write("Error parsing JSON:", error);
116+
process.stdout.write("Error parsing JSON: " + error);
117117
return null
118118
}
119119
}

0 commit comments

Comments
 (0)