diff --git a/upload/upload.py b/upload/upload.py index f3e7318096f5a73f5447c2514abe631925374a82..0a1299a2b48461b4c03ff7c1ecb077c09a1f2ff2 100755 --- a/upload/upload.py +++ b/upload/upload.py @@ -156,6 +156,17 @@ for record in records: data=content, headers=auth_json_header, ) + + # errors in the metadata are reported via the "errors" field in the response + if data and "errors" in data: + print( + "errors from response at step '{}' while processing '{}':".format( + step, record + ), + file=sys.stderr, + ) + print(data["errors"], file=sys.stderr) + recid = data["id"] # if there are any files to be uploaded, invenio needs to know about them