Directus / @directus/errors / isDirectusError
Function: isDirectusError() ​
isDirectusError<
T
,C
>(value
,code
?):value is DirectusError<[T] extends [never] ? C extends ErrorCode ? ExtensionsMap[C<C>] : unknown : T>
Check whether or not a passed value is a valid Directus error.
Type Parameters ​
• T = never
• C extends string
= string
Parameters ​
• value: unknown
Any value
• code?: C
Error code to check for
Returns ​
value is DirectusError<[T] extends [never] ? C extends ErrorCode ? ExtensionsMap[C<C>] : unknown : T>