Skip to content

Commit

Permalink
fix: 🐛 fix the job status (error) when an error occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Jan 20, 2022
1 parent 6b7eec5 commit e3c1cbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/datasets_preview_backend/io/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,11 @@ def refresh_dataset_split_full_names(dataset_name: str, hf_token: Optional[str]
except StatusError as err:
upsert_dataset_error(dataset_name, err)
logger.debug(f"dataset '{dataset_name}' had error, cache updated")
raise err
except Exception as err:
upsert_dataset_error(dataset_name, Status500Error(str(err)))
logger.debug(f"dataset '{dataset_name}' had error, cache updated")
return []
raise err


def delete_split(split_full_name: SplitFullName):
Expand Down Expand Up @@ -421,11 +422,13 @@ def refresh_split(
logger.debug(
f"split '{split_name}' from dataset '{dataset_name}' in config '{config_name}' had error, cache updated"
)
raise err
except Exception as err:
upsert_split_error(dataset_name, config_name, split_name, Status500Error(str(err)))
logger.debug(
f"split '{split_name}' from dataset '{dataset_name}' in config '{config_name}' had error, cache updated"
)
raise err


def list_split_full_names_to_refresh(dataset_name: str):
Expand Down

0 comments on commit e3c1cbd

Please sign in to comment.