Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit dd25efe

Browse files
authored
Stop showing stack trace as it is not helpful to LLM (#1012)
* Stop showing stack trace as it is not helpful to LLM * update
1 parent 63e678a commit dd25efe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎core/src/AzureMcp.Core/Commands/BaseCommand.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ protected virtual void HandleException(CommandContext context, Exception ex)
4444
var response = context.Response;
4545
var result = new ExceptionResult(
4646
Message: ex.Message,
47+
#if DEBUG
4748
StackTrace: ex.StackTrace,
49+
#else
50+
StackTrace: null,
51+
#endif
4852
Type: ex.GetType().Name);
4953

5054
response.Status = GetStatusCode(ex);

0 commit comments

Comments
 (0)