# Diagnosing a stack trace — prompt for ChatGPT

Distinguish where an error occurs from its possible cause and choose the next check.

Canonical URL: https://boswidget.ru/en/diagnosing-a-stack-trace-prompt-for-chatgpt/

Model: ChatGPT

Category: Code

Tags: error, stack trace, diagnostics

![Diagnosing a stack trace](https://boswidget.ru/assets/images/text-preview-cg-triage-po-stacktrace-1200.0ba549271368.webp)

Diagnosing a stack trace

## Prompt

Analyze this error: {trace}. Relevant code and environment: {context}. Known reproduction conditions: {steps}. Identify the primary error and call chain, pointing to related code lines. Propose up to three hypotheses with evidence that would support or refute each. Give a minimal safe action for the first check. Do not invent missing lines, library versions or execution results. If information is insufficient, request a specific excerpt rather than the entire project.

## Template fields

- `{trace}` — Error. Example input: Error message and stack trace without tokens or personal information
- `{context}` — Code and environment. Example input: Relevant excerpt, language and known versions
- `{steps}` — Reproduction steps. Example input: Input, action and expected behavior

## Launch

[Open ChatGPT in YesAI](https://yesai.su/en/chatgpt)
