---
title: "Codeunit 1291 DotNet Exception Handler, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/points/
object: https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 1291 DotNet Exception Handler, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/points/

5 procedures and triggers with a step in src/Layers/W1/BaseApp/Modules/System/ExceptionHandling/DotNetExceptionHandler.Codeunit.al, in source order, read from the text, not from a run.

## Catch

[Line 18](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L18).

- [20](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L20) calls `Collect`
- [21](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L21) calls `CastToType`
- [22](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L22) calls `Rethrow`

## TryCastToType

[Line 36](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L36).

- [40](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L40) calls `CastToType`

## CastToType

[Line 44](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L44).

- [46](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L46) calls `IsCollected`

## GetMessage

[Line 59](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L59).

- [63](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L63) calls `IsCollected`

## Rethrow

[Line 73](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L73).

- [77](https://jonas-paprotka.de/ref/codeunit/1291-dotnet-exception-handler/source/#L77) calls `GetMessage`

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
