From 4c1beadcba7381ae3b938947bd06c8785ca11fb9 Mon Sep 17 00:00:00 2001 From: entrywayaudibly <71117336+entrywayaudibly@users.noreply.github.com> Date: Wed, 21 Oct 2020 18:51:22 +0000 Subject: [PATCH] Docs: Add subtitles for registry error messages (#2502) --- docs/api/registry.md | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/docs/api/registry.md b/docs/api/registry.md index c25198a3d..008c959f8 100644 --- a/docs/api/registry.md +++ b/docs/api/registry.md @@ -7,7 +7,6 @@ sidebar_label: registry() # registry() - Allows custom registries to be plugged into the task system, which can provide shared tasks or augmented functionality. **Note:** Only tasks registered with `task()` will be provided to the custom registry. The task functions passed directly to `series()` or `parallel()` will not be provided - if you need to customize the registry behavior, compose tasks with string references. @@ -50,14 +49,34 @@ If a `registryInstance` is passed, nothing will be returned. If no arguments are ### Errors -When a constructor (instead of an instance) is passed as `registryInstance`, throws an error with the message, "Custom registries must be instantiated, but it looks like you passed a constructor". +#### Incorrect Parameter + +When a constructor (instead of an instance) is passed as `registryInstance`, throws an error with the message: + +> Custom registries must be instantiated, but it looks like you passed a constructor. + +#### Missing get Method + +When a registry without a `get` method is passed as `registryInstance`, throws an error with the message: + +> Custom registry must have `get` function. + +#### Missing set Method + +When a registry without a `set` method is passed as `registryInstance`, throws an error with the message: + +> Custom registry must have `set` function. + +#### Missing init Method + +When a registry without an `init` method is passed as `registryInstance`, throws an error with the message: -When a registry without a `get` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `get` function". +> Custom registry must have `init` function" -When a registry without a `set` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `set` function". +#### Missing tasks Method -When a registry without an `init` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `init` function" +When a registry without a `tasks` method is passed as `registryInstance`, throws an error with the message: -When a registry without a `tasks` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `tasks` function". +> Custom registry must have `tasks` function. [creating-custom-registries]: ../advanced/creating-custom-registries.md