File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
sources/platform/actors/development/actor_definition/dataset_schema Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ description: Specify the dataset schema within the Actors so you can add monito
44slug : /actors/development/actor-definition/dataset-schema/validation
55---
66
7+ import Tabs from '@theme/Tabs ';
8+ import TabItem from '@theme/TabItem ';
9+
710** Specify the dataset schema within the Actors so you can add monitoring and validation at the field level.**
811
912---
@@ -105,6 +108,8 @@ The type of the AJV validation error object is [here](https://github.com/ajv-val
105108
106109If you use the Apify JS client or Apify SDK and call ` pushData ` function you can access the validation errors in a ` try catch ` block like this:
107110
111+ <Tabs >
112+ <TabItem value =" Javascript " label =" Javascript " default >
108113``` javascript
109114try {
110115 const response = await Actor .pushData (items);
@@ -115,6 +120,17 @@ try {
115120 });
116121}
117122` ` `
123+ </TabItem>
124+ <TabItem value="Python" label="Python">
125+ ` ` ` python
126+ try :
127+ await Actor .push_data (items)
128+ except ApifyApiError as error:
129+ if " invalidItems" in error .data :
130+ validation_errors = e .data [" invalidItems" ]
131+ ` ` `
132+ </TabItem>
133+ </Tabs>
118134
119135## Examples of common types of validation
120136
You can’t perform that action at this time.
0 commit comments