177 | | By default, an import request will be rolled back and an HTTP 400 BAD REQUEST error be raised if the source contains any invalid data. You can override this behavior by using the ''ignore_errors'' URL variable (with any non-empty string, e.g. {{{?ignore_errors=True}}}) - invalid records would then be skipped, while all other records imported, and the request would return a HTTP 200 OK. The JSON message would though however contain the error message and the element tree. The ''ignore_errors'' option is meant for "dirty" data, e.g. cases where you need to import from a source but do not have permission and/or means to clean it up before import - where possible, you should avoid ignore_errors and rather sanitize the source. |
| 177 | **Skipping invalid records at import: |
| 178 | |
| 179 | By default, an import request will be rolled back (completely) and an HTTP 400 BAD REQUEST error be raised if the source contains any invalid data. You can override this behavior by using the ''ignore_errors'' URL variable (with any non-empty string, e.g. {{{?ignore_errors=True}}}) - invalid records would then be skipped, while the valid ones would be committed to the database and the request return a HTTP 200 OK. The JSON message would though however contain the error message and the element tree. Note that ignore_errors applies to Validation Errors only. Any other error (e.g. XML syntax error) will be handled as usual (=rollback + error message). |
| 180 | |
| 181 | The ''ignore_errors'' option is meant for "dirty" data, e.g. cases where you need to import from a source but do not have permission and/or means to clean it up before import - where possible, you should avoid ignore_errors and rather sanitize the source. |