Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Latest
------

### Changes
* [#78](https://github.com/cleverage/cache-process-bundle/issues/78) Reference pages: exceptions of the bundle, input keys of `cache_get` / `cache_set`.

v2.3
------

Expand Down
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,10 @@ delete_from_cache:

- [Share data between process branches](cookbooks/share_data_between_branches.md)
- [Warm up a persistent cache from a file](cookbooks/cache_warmup.md)

## Exceptions

The exceptions named without namespace in the reference pages (e.g. `UnexpectedValueException`) are the ones of the
bundle, `CleverAge\CacheProcessBundle\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.
4 changes: 2 additions & 2 deletions docs/reference/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Notes

* The adapters are registered by the `code` attribute of their tag, in a service locator built when the container is
compiled: an adapter is only instantiated when a task uses it (an error in an adapter that a process does not use
does not make it fail). The `code` must be the one returned by `getCode()` (an `\UnexpectedValueException` is thrown
does not make it fail). The `code` must be the one returned by `getCode()` (an `UnexpectedValueException` is thrown
otherwise when it is fetched). Two adapters with the same code, or an empty code, fail the container compilation.
`AdapterRegistry::hasAdapter()` and `getAdapters()` (which instantiates every adapter) are available, e.g. in a
custom cache task.
Expand All @@ -130,7 +130,7 @@ Notes
compilation. A pool must be tagged with a `code`.
* **Deprecated**: a service tagged without `code` is still registered, with `AdapterRegistry::addAdapter()`,
instantiated with the registry (deprecated since 2.3, the `code` will be required in 3.0). Two adapters with the same
code then throw an `\UnexpectedValueException` giving the ids of both services
code then throw an `UnexpectedValueException` giving the ids of both services
(`Adapter <code> is already defined by service "<id>", cannot register service "<id>"`) when the registry is
instantiated, i.e. the first time a cache task is used.
* Using a code that is not registered throws a `CleverAge\CacheProcessBundle\Exception\MissingAdapterException`
Expand Down
10 changes: 5 additions & 5 deletions docs/reference/tasks/get_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Task reference
Accepted inputs
---------------

`array` or empty (`null`): if the input is not empty, its keys `adapter` and `key` override the options of the same
name, and are validated like the options (e.g. a non-string `key` throws an `InvalidOptionsException`). Other input
keys are ignored.
`array` or empty (`null`): if the input is not empty, its keys named after an option (`adapter`, `key`, `on_miss`)
override the options of the same name, and are validated like the options (e.g. a non-string `key` throws an
`InvalidOptionsException`). Other input keys are ignored.

Any other non-empty input (e.g. a `string`) throws an `\UnexpectedValueException`.
Any other non-empty input (e.g. a `string`) throws an `UnexpectedValueException`.

Possible outputs
----------------
Expand All @@ -42,7 +42,7 @@ input, an option given by neither throws a `MissingOptionsException` on executio
* `output_null`: output `null`, as for an item stored with a `null` value.
* `skip`: skip the item and send the input to the error outputs (`error_outputs`), e.g. to compute the missing value
and store it.
* `fail`: throw an `\UnexpectedValueException` (`Cache item <key> is missing from adapter <adapter>`).
* `fail`: throw an `UnexpectedValueException` (`Cache item <key> is missing from adapter <adapter>`).

Examples
--------
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/tasks/set_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Task reference
Accepted inputs
---------------

`array` or empty (`null`): if the input is not empty, its keys `adapter`, `key` and `value` override the options of the
same name, and are validated like the options (e.g. a non-string `key` throws an `InvalidOptionsException`). Other
input keys are ignored.
`array` or empty (`null`): if the input is not empty, its keys named after an option (`adapter`, `key`, `value`,
`expires_after`) override the options of the same name, and are validated like the options (e.g. a non-string `key`
throws an `InvalidOptionsException`). Other input keys are ignored.

Any other non-empty input (e.g. a `string`) throws an `\UnexpectedValueException`.
Any other non-empty input (e.g. a `string`) throws an `UnexpectedValueException`.

Possible outputs
----------------
Expand Down
Loading