We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cc7212a + 06c1b29 commit 34ca1f5Copy full SHA for 34ca1f5
src/connections/functions/insert-functions.md
@@ -113,6 +113,7 @@ You can `throw` the following pre-defined error types to indicate that the funct
113
- `InvalidEventPayload`
114
- `ValidationError`
115
- `RetryError`
116
+- `DropEvent`
117
118
The examples show basic uses of these error types.
119
@@ -156,6 +157,14 @@ async function onTrack(event) {
156
157
}
158
159
160
+async function onIdentify(event) {
161
+ if (event.traits.companyName) {
162
+ // Drop Event | Do NOT forward event to destination
163
+ throw new DropEvent('Company name is required')
164
+ }
165
+ return event;
166
+}
167
+
168
```
169
If you don't supply a function for an event type, Segment throws an `EventNotSupported` error by default.
170
0 commit comments