# System.GetLastErrorText(Boolean) Method
> Version: _Available or changed with runtime version 7.0._
Gets the last error that occurred in the debugger.
## Syntax
```al
String :=   System.GetLastErrorText(ExcludeCustomerContent: Boolean)
```
> NOTE
> This method can be invoked without specifying the data type name.
## Parameters
ExcludeCustomerContent
Type: ../boolean/boolean-data-type
Exclude sensitive data, such as primary key values, from the error message.
## Return Value
String
Type: ../text/text-data-type
## Remarks
If you call the GetLastErrorText method immediately after you call the ClearLastError method, then an empty string is returned.
The result of the system-getlasterrorcode-method is not translated into the local language. The result of the GetLastErrorText method is translated into the local language.
## Related information
system-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-getlasterrortext-boolean-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-getlasterrortext-boolean-method/
