add exceptions
From ~/.slk/slk-cli.log
, we can derive some more useful exception handling, e.g., let's collect some errocodes here.
SizeMismatchError
Error: Code: 400, Reason: BAD_REQUEST, Message: Size Mismatch, Detailed Message: RCR size: 44894894080 does not match the expected size: 43846318080
2023-04-17 14:57:39 l40002.lvt.dkrz.de 375635 INFO Non-recursive Archive failed
However, the slk archive
command here returend errorcode 1
pyslk.exceptions.PySlkException: pyslk.slk_archive
errorcode: 1
stdout: Non-recursive Archive failed
stderr:
It seems that we can not really distinguish erros from the command returncode.
IOError
Error: Code: 410, Reason: NOT_FOUND, Message: IO Exception, Detailed Message: Namespace not bound to Smart Pool
2023-04-17 15:26:40 l40060.lvt.dkrz.de 332372 INFO Non-recursive Archive failed
These errors are not reflected in stderr, so we can not capture it yet. Let's check and print the errorcode in PySlkException. That could give more info than just Non-recursive Archive failed
.
Edited by Lars Buntemeyer