---
title: "Breaking: #105920 - Folder->getSubFolder() throws FolderDoesNotExistException"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:breaking-105920-1736777357"
source: "Changelog/14.0/Breaking-105920-Folder-getSubFolderThrowsFolderDoesNotExistException.rst"
typo3-version: "14.0"
typo3-major: 14
type: "breaking"
issue: 105920
forge: "https://forge.typo3.org/issues/105920"
tags: ["FAL", "PHP-API", "NotScanned", "ext:core"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Breaking: #105920 - Folder->getSubFolder() throws FolderDoesNotExistException {#breaking-105920-1736777357}

See [forge#105920](https://forge.typo3.org/issues/105920)

## Description {#description}

An exception handling detail within the **File Abstraction Layer (FAL) resource
handling** has been changed. When calling
`getSubFolder('mySubFolderName')` on a
`Folder` object, and if this subfolder does
not exist, the specific
`\TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException` is
now raised instead of the global `\InvalidArgumentException`.

## Impact {#impact}

The change may affect extensions that directly or indirectly call
`Folder->getSubFolder()` and expect a `\InvalidArgumentException` to
be thrown.

## Affected installations {#affected-installations}

`FolderDoesNotExistException` does not extend
`\InvalidArgumentException`. Code that currently expects a
`\InvalidArgumentException` to be thrown needs to be adapted.

## Migration {#migration}

The change is breaking for code that takes an "optimistic" approach like:
"get the subfolder object, and if this throws, create one". Example:

```php
try {
    $mySubFolder = $myFolder->getSubFolder('mySubFolder');
} catch (\InvalidArgumentException) {
    $mySubFolder = $myFolder->createFolder('mySubFolder');
}
```

This should be changed to catch a
`FolderDoesNotExistException`
instead:

```php
use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;

try {
    $mySubFolder = $myFolder->getSubFolder('mySubFolder');
} catch (FolderDoesNotExistException) {
    $mySubFolder = $myFolder->createFolder('mySubFolder');
}
```

Extensions that need to stay compatible with both TYPO3 v13 and v14 should catch
both exceptions and should later avoid catching
`\InvalidArgumentException` when v13 compatibility is dropped:

```php
use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;

try {
    $mySubFolder = $myFolder->getSubFolder('mySubFolder');
} catch (\InvalidArgumentException|FolderDoesNotExistException) {
    // @todo: Remove \InvalidArgumentException from catch list when
    //        TYPO3 v13 compatibility is dropped.
    $mySubFolder = $myFolder->createFolder('mySubFolder');
}
```
