Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.48 KB

File metadata and controls

39 lines (30 loc) · 1.48 KB

1. Errors

  1. Types of Errors

    • Syntax Errors : 괄호같은 Syntax 에러
    • Runtime Errors
    • Logical Errors : 에러 메세지가 없지만 우리가 의도한 방향으로 작동하지 않는다.. 따라서 오류 찾기가 어려움.
  2. Debugging

    VS code 에서는 디버거를 제공해준다. 아주 강력한 기능이므로 사용하도록 하자. 우선 브레이크 포인트를 통해 코드 실행을 멈출 수 있다. 개발중에 잘못된 곳이 있다고 생각되면 브레이크 포인트를 지정하고 그 지점까지 실행된 코드를 다시 본다.
    이때 콘솔을 활용하면 실제 코드에 영향을 주지 않고 메소드를 실행할 수 있다.

  3. 디버거 자동 재시작

    • Debug 메뉴 > Add Configuration > json 파일에 아래 세줄 추가

      {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
          {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": ["<node_internals>/**"],
            "program": "${workspaceFolder}\\app.js",
            "restart": true,                //  추가
            "runtimeExecutable": "nodemon"  //	 추가
            "console": "integratedTerminal" //	 추가
          }
        ]
      }