Skip to content

Commit

Permalink
Merge pull request #777 from dandi/validation-error
Browse files Browse the repository at this point in the history
Fix display of Dandiset validation errors
  • Loading branch information
yarikoptic authored Sep 27, 2021
2 parents 7bba7ff + 9774952 commit c3305d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,13 @@ def wait_until_valid(self, min_time=20):
if r["status"] == "Valid":
return
sleep(0.5)
# TODO: Improve the presentation of the error messages
about = {
"asset_validation_errors": r.get("asset_validation_errors"),
"version_validation_errors": r.get("version_validation_errors"),
}
raise ValueError(
f"Dandiset {self.identifier} is {r['status']}: {r['validation_error']}"
f"Dandiset {self.identifier} is {r['status']}: {json.dumps(about, indent=4)}"
)

def publish(self) -> "RemoteDandiset":
Expand Down

0 comments on commit c3305d5

Please sign in to comment.