diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d63a7e..81bb33c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Latest ------ +### Changes +* [#84](https://github.com/cleverage/flysystem-process-bundle/issues/84) Reference pages: exceptions of the bundle. + ### Fixes * [#75](https://github.com/cleverage/flysystem-process-bundle/issues/75) `FileFetchTask` (`flysystem_file_fetch`): an unknown storage fails at initialization with an explicit message (`Unknown storage "…" (option "…")`, with the known storages) instead of `Service "…" not found`, When the task is executed after a failed initialization (process-bundle v5 goes on), it fails with an explicit message instead of `Typed property … must not be accessed before initialization`. Update documentation, add tests. diff --git a/docs/index.md b/docs/index.md index 9f619ed..fe2f48c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -83,3 +83,10 @@ No option can be configured under `cleverage_flysystem_process`: a key there is - [SFTP stale connection on long-running processes](troubleshooting.md#sftp-long-running-process-fails-with-got-packet-type--connection-closed-prematurely) (`Got packet type` / `Connection closed prematurely`) - [CleverAge/ProcessBundle documentation](https://github.com/cleverage/process-bundle/blob/main/docs/index.md) + +## Exceptions + +The exceptions named without namespace in the reference pages (e.g. `UnexpectedValueException`) are the ones of the +bundle, `CleverAge\FlysystemProcessBundle\Exception\*`: they extend the SPL exceptions of the same name and implement +`CleverAge\ProcessBundle\Exception\ProcessExceptionInterface`, so that all the errors of the process bundles can be +caught at once. diff --git a/docs/reference/tasks/file_fetch_task.md b/docs/reference/tasks/file_fetch_task.md index 6f24c03..4d34352 100644 --- a/docs/reference/tasks/file_fetch_task.md +++ b/docs/reference/tasks/file_fetch_task.md @@ -19,7 +19,7 @@ Accepted inputs * When `file_pattern` is set, the input is ignored. * Otherwise, `string|array`: path, or list of paths, of the file(s) to copy, relative to the root of the - `source_filesystem` storage. An empty input throws an `\UnexpectedValueException` + `source_filesystem` storage. An empty input throws an `UnexpectedValueException` (`No pattern neither input provided for the Task`). If the task is the first task of the process and takes its files from the input, set the process `entry_point` to @@ -43,7 +43,7 @@ Options | `destination_filesystem` | `string` | **X** | | Name of the Flysystem storage to write files to, as configured under `flysystem.storages` | | `file_pattern` | `string\|null` | | `null` | Regular expression (see [preg_match](https://www.php.net/manual/en/function.preg-match.php)) tested on the path of each file at the root of `source_filesystem`. If `null` (or empty), the file path(s) are taken from the input | | `remove_source` | `bool` | | `false` | Delete the file from `source_filesystem` after the copy (move instead of copy) | -| `ignore_missing` | `bool` | | `true` | If `false`, throw an `\UnexpectedValueException` when no file matches `file_pattern` (`File(s) not found in source filesystem`) or when a file given as input does not exist (`File not found in source filesystem`). If `true`, missing files are skipped | +| `ignore_missing` | `bool` | | `true` | If `false`, throw an `UnexpectedValueException` when no file matches `file_pattern` (`File(s) not found in source filesystem`) or when a file given as input does not exist (`File not found in source filesystem`). If `true`, missing files are skipped | Examples -------- diff --git a/docs/reference/tasks/remove_file_task.md b/docs/reference/tasks/remove_file_task.md index 6f7a667..5cad791 100644 --- a/docs/reference/tasks/remove_file_task.md +++ b/docs/reference/tasks/remove_file_task.md @@ -14,7 +14,7 @@ Accepted inputs * When `file_pattern` is set, the input is ignored (but the deletion is run again each time the task is executed). * Otherwise, `string|array`: path, or list of paths, of the file(s) to delete, relative to the root of the - `filesystem` storage. An empty input throws an `\UnexpectedValueException` (`No pattern neither input provided for + `filesystem` storage. An empty input throws an `UnexpectedValueException` (`No pattern neither input provided for the Task`). A `StorageAttributes` output of [ListContentTask](list_content_task.md) must be converted to its `path` first.