Skip to content

Commit

Permalink
make messages more precise
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Nov 21, 2023
1 parent fbb29a8 commit b5f6af9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dsp_permissions_scripts/oap/oap_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _write_failed_res_iris_to_file(
filename: str,
) -> None:
with open(filename, "w", encoding="utf-8") as f:
f.write(f"Failed to update the OAPs of the following resources in project {shortcode} on host {host}:\n")
f.write(f"Problems occurred while updating the OAPs of these resources (project {shortcode}, host {host}:\n")
f.write("\n".join(failed_res_iris))


Expand Down Expand Up @@ -231,5 +231,9 @@ def apply_updated_oaps_on_server(
host=host,
filename=filename,
)
logger.error(f"ERROR: {len(failed_res_iris)} resources could not be updated. They were written to {filename}.")
warnings.warn(f"ERROR: {len(failed_res_iris)} resources could not be updated. They were written to {filename}.")
msg = (
f"ERROR: {len(failed_res_iris)} resources could not (or only partially) be updated. "
f"They were written to {filename}."
)
logger.error(msg)
warnings.warn(msg)

0 comments on commit b5f6af9

Please sign in to comment.