Home > Mobile >  Visual Studio: Errors only showing in terminal after running code
Visual Studio: Errors only showing in terminal after running code

Time:12-04

No errors are shown in the "problems" tab nor in the code itself. How do I get these errors to show up in the "problems" tab and in my code for easier debugging?

Right now it says "No problems have been detected in the workspace." When my code runs with errors in the terminal.

I tried reinstalling and resetting my settings, no luck.

error example (only shown in terminal):

Traceback (most recent call last):
  File "redacted", line 29, in <module>
    main()
  File "redacted", line 6, in main
    deal_cards(deck, numcards)
  File "redacted", line 17, in deal_cards
    if number > len(deck):
TypeError: object of type 'NoneType' has no len()

CodePudding user response:

It sounds like you are using an Integrated Development Environment (IDE) to write and run your code, but the IDE is not showing any errors or warnings when your code contains mistakes.

There are a few possible reasons for this. First, it is possible that your IDE is not properly configured to display errors and warnings. In this case, you can try looking for settings or preferences related to error and warning display, and make sure that these are enabled.

Second, it is possible that your code contains mistakes that the IDE is not able to detect. This can happen if your code contains syntax errors or other problems that the IDE is not designed to recognize. In this case, you can try running your code through a compiler or interpreter, which will typically provide more detailed error messages that can help you identify and fix problems in your code.

Finally, it is also possible that your code is actually correct and does not contain any errors or warnings. In this case, the IDE will not show any errors or warnings because there are none to display.

Overall, the best way to troubleshoot problems with error and warning display in your IDE will depend on the specific tools and settings you are using. You may need to consult the documentation for your IDE, compiler, or interpreter to learn how to configure error and warning display and how to interpret the error messages that are generated.

CodePudding user response:

The error you show is a runtime error (an error that happens when a program is run, not before) and the Errors window doesn't show runtime errors.

  • Related