Skip to content

Stacktrace on exceptions #7014

@svrooij

Description

@svrooij

We were having issues with a badly formatted json for using the flags extension (please more documentation on this).

The error message was something like: source cannot be null (very unhelpful). For now I got the Kiota source, put a try-catch around the command in the Main(...) method.

This gave me way more information, and pointed us in the right direction.

Some ideas that could make this process better:

  1. Try-catch around the parsing of the specs, with a decent log message logger.LogWarning(ex, "Error parsing specification {Path}", specsPath) with a rethrow so it still fails.
  2. try-catch in the main method, that as a last ditch effort just writes the entire exception to the console (what if something is wrong with the logger setup)

Metadata

Metadata

Assignees

No one assigned

    Labels

    generatorIssues or improvements relater to generation capabilities.good first issueGood for newcomerstype:taskGeneral task, can be long-running type

    Type

    No type

    Projects

    Status

    Proposed 💡

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions