You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Utility function that creates an Error suitable for gRPC responses.
27
22
See tests for all examples
28
23
@@ -31,20 +26,17 @@ See tests for all examples
31
26
32
27
| Param | Type | Description |
33
28
| --- | --- | --- |
34
-
| message | <code>String</code> \| <code>Number</code> \| <code>Error</code> \| <code>Object</code> | If <code>String</code> the error message If <code>Number</code> the error code If instanceof <code>Error</code>, the error to source data from. We still create a new <code>Error</code> instance, copy data from the passed error and assign / merge the rest of arguments. This can be used to mege metadata of existing error with additional metadata. If <code>Object</code>, assumed to be metadata, either plain object representation or actual <code>grpc.Metadata</code> instance. We use <code>grpc-create-metadata</code> module to create metadata for the return value. |
35
-
| code | <code>Number</code> \| <code>Object</code> | If <code>Number</code> the error code If <code>Object</code>, assumed to be metadata, either plain object representation or actual <code>grpc.Metadata</code> instance. We use <code>grpc-create-metadata</code> module to create metadata for the return value. |
36
-
| metadata | <code>Object</code> | The error metadata. Either plain object representation or actual <code>grpc.Metadata</code> instance. We use <code>grpc-create-metadata</code> module to create metadata for the return value. |
29
+
| [message] | <code>String</code> \| <code>Number</code> \| <code>Error</code> \| <code>Object</code> | If <code>String</code> the error message If <code>Number</code> the error code If instanceof <code>Error</code>, the error to source data from. We still create a new <code>Error</code> instance, copy data from the passed error and assign / merge the rest of arguments. This can be used to mege metadata of existing error with additional metadata. If <code>Object</code>, assumed to be metadata, either plain object representation or actual <code>grpc.Metadata</code> instance. We use <code>grpc-create-metadata</code> module to create metadata for the return value. |
30
+
|[code]| <code>Number</code> \| <code>Object</code> | If <code>Number</code> the error code If <code>Object</code>, assumed to be metadata, either plain object representation or actual <code>grpc.Metadata</code> instance. We use <code>grpc-create-metadata</code> module to create metadata for the return value. |
31
+
|[metadata]| <code>Object</code> | The error metadata. Either plain object representation or actual <code>grpc.Metadata</code> instance. We use <code>grpc-create-metadata</code> module to create metadata for the return value. |
0 commit comments