Skip to content

Commit

Permalink
Merge pull request #1152 from dandi/fix-logging-errors
Browse files Browse the repository at this point in the history
Use `logging.info` for user errors instead of `logging.error`
  • Loading branch information
mvandenburgh authored Jul 1, 2022
2 parents 630949f + 42e6d38 commit 3d54820
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dandiapi/api/models/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _populate_metadata(self, version_with_assets: Version = None):
except Exception:
# The assets summary aggregation may fail if any asset metadata is invalid.
# If so, just use the placeholder summary.
logger.error('Error calculating assetsSummary', exc_info=1)
logger.info('Error calculating assetsSummary', exc_info=1)

# Import here to avoid dependency cycle
from dandiapi.api.manifests import manifest_location
Expand Down
2 changes: 1 addition & 1 deletion dandiapi/api/models/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def checksum(self) -> str | None:
except ValidationError:
return EMPTY_CHECKSUM
except pydantic.ValidationError as e:
logger.error(e, exc_info=True)
logger.info(e, exc_info=True)
return None

@property
Expand Down
4 changes: 2 additions & 2 deletions dandiapi/api/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def validate_asset_metadata(asset_id: int) -> None:
metadata = asset.published_metadata()
validate(metadata, schema_key='PublishedAsset', json_validation=True)
except dandischema.exceptions.ValidationError as e:
logger.error('Error while validating asset %s', asset_id)
logger.info('Error while validating asset %s', asset_id)
asset.status = Asset.Status.INVALID

validation_errors = collect_validation_errors(e)
Expand Down Expand Up @@ -137,7 +137,7 @@ def validate_version_metadata(version_id: int) -> None:

validate(metadata, schema_key='PublishedDandiset', json_validation=True)
except dandischema.exceptions.ValidationError as e:
logger.error('Error while validating version %s', version_id)
logger.info('Error while validating version %s', version_id)
version.status = Version.Status.INVALID

validation_errors = collect_validation_errors(e)
Expand Down

0 comments on commit 3d54820

Please sign in to comment.