Skip to content

Commit 4c1bead

Browse files
Docs: Add subtitles for registry error messages (#2502)
1 parent 6e56ed8 commit 4c1bead

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

docs/api/registry.md

+25-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ sidebar_label: registry()
77

88
# registry()
99

10-
1110
Allows custom registries to be plugged into the task system, which can provide shared tasks or augmented functionality.
1211

1312
**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
5049

5150
### Errors
5251

53-
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".
52+
#### Incorrect Parameter
53+
54+
When a constructor (instead of an instance) is passed as `registryInstance`, throws an error with the message:
55+
56+
> Custom registries must be instantiated, but it looks like you passed a constructor.
57+
58+
#### Missing get Method
59+
60+
When a registry without a `get` method is passed as `registryInstance`, throws an error with the message:
61+
62+
> Custom registry must have `get` function.
63+
64+
#### Missing set Method
65+
66+
When a registry without a `set` method is passed as `registryInstance`, throws an error with the message:
67+
68+
> Custom registry must have `set` function.
69+
70+
#### Missing init Method
71+
72+
When a registry without an `init` method is passed as `registryInstance`, throws an error with the message:
5473

55-
When a registry without a `get` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `get` function".
74+
> Custom registry must have `init` function"
5675
57-
When a registry without a `set` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `set` function".
76+
#### Missing tasks Method
5877

59-
When a registry without an `init` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `init` function"
78+
When a registry without a `tasks` method is passed as `registryInstance`, throws an error with the message:
6079

61-
When a registry without a `tasks` method is passed as `registryInstance`, throws an error with the message, "Custom registry must have `tasks` function".
80+
> Custom registry must have `tasks` function.
6281
6382
[creating-custom-registries]: ../advanced/creating-custom-registries.md

0 commit comments

Comments
 (0)