Replies: 4 comments
-
@RasmusN Good question. In the You'll find a usage example in the The If If you want to handle the download error yourself, instead of automatically exiting the interpreter, you could catch the For example (off the top of my head): ...
client = Client(
...,
refresh_required=True,
)
try:
updates = client.check_for_updates()
except SystemExit:
updates = None
... # <-- do your thing here
if updates:
client.download_and_apply_update(...)
... I haven't tested this, but I suppose it should work. |
Beta Was this translation helpful? Give feedback.
-
@dennisvang Thanks this works! Is there a specific reason why the client exists the entire process rather than raising a (custom) exception? |
Beta Was this translation helpful? Give feedback.
-
@RasmusN Good to hear it works. Basically, the intention of The idea was to offer a simple interface, so the app creator would not need to worry about catching the right exceptions, although you could argue it's a bit restrictive. Another alternative was to add a user callback argument which defaults to |
Beta Was this translation helpful? Give feedback.
-
@dennisvang Alright I understand, makes sense |
Beta Was this translation helpful? Give feedback.
-
What is the proper way to check if the remote repository is available?
(Yes I know, questions are supposed to be posted to stackoverflow with the "tufup" tag. However, since the tag doesn't exist it's not possible to use it unless you already are a stackoverflow guru with 1500 reputation points.)
I tried refreshing the client and catching the DownloadHTTPError before running the update:
but this causes an error when calling the
client.check_for_updates
method:RuntimeError: Cannot update timestamp after snapshot
System info (please complete the following information):
Beta Was this translation helpful? Give feedback.
All reactions