Troubleshooting a Salesforce error means picking the right error console based on where the error happened. Apex errors go to the Developer Console; UI errors go to the browser; integration errors go to Setup pages.
- Identify the layer where the error occurred
Apex code error? Developer Console. Lightning Web Component error? Browser console. Email failure? Email Logs. Integration failure? API Usage. The layer determines the right error console to open.
- Open the appropriate error console
For Apex: Developer Console, then Logs tab. For LWC: browser F12, then Console tab. For email: Setup, then Email Logs. For integration: Setup, then API Usage.
- Set up logging if needed
For Apex errors, set a Trace Flag for the affected user with appropriate Debug Levels. Reproduce the issue. The log appears in the Developer Console.
- Read the error
In the Developer Console: search for EXCEPTION_THROWN. In the browser: scroll to the latest error with a red icon. The error message usually identifies the failing code and the cause.
- Trace to root cause
The error message names the symptom. Trace backward through the log or stack trace to find the originating code. For Apex, the line in your code where the exception was thrown is usually the smoking gun.
- Fix, deploy, and confirm
Make the fix in your code. Deploy to the affected environment. Reproduce the original scenario to confirm the error is gone. Document the fix in your change log.
Primary Apex error surface. Shows runtime exceptions with stack traces.
Compile errors for Apex classes and triggers.
Client-side errors for LWC, Aura, and Visualforce pages.
Outbound email delivery failures.
Integration call counts and error rates.
- Different errors surface in different consoles. An LWC error that does not show in the Apex log does not mean the code is fine; check the browser console.
- Trace Flags expire automatically. Long debugging sessions need fresh flags or you stop capturing logs mid-session.
- Email Logs retain only 30 days. Older email failures cannot be diagnosed from logs alone.
- Browser console errors are user-specific. An error one user sees does not appear in another user''s browser; reproduce in the affected environment.