Exception when executing locate command on non-existing/unreadable path

Issue #51 open
Mats Ekberg
repo owner created an issue

Originally reported on Google Code with ID 51

What steps will reproduce the problem?
1. Execute "boar locate --repo=/some/repo locate SomeSession /non-existing/path"

What is the expected output? What do you see instead?
There should be a nice error message. There is an ugly exception.

Please use labels and text to provide additional information.

Reported by mats_ekberg on 2012-02-11 10:09:22

Comments (1)

  1. krissen

    Would "the ugly exception" be the following?

     $ boar locate bilder *.jpg                                                                                                                   
    Traceback (most recent call last):                                                                                                                                       
      File "/usr/local/bin/boar", line 1497, in <module>
        return_code = main()
      File "/usr/local/bin/boar", line 1422, in main
        return cmd_locate(args[1:])
      File "/usr/local/bin/boar", line 207, in cmd_locate
        csum = md5sum_file(f)
      File "/opt/boar/common.py", line 212, in md5sum_file
        return checksum_file(f, ["md5"], start, end, progress_callback = progress_callback)[0]
      File "/opt/boar/common.py", line 245, in checksum_file
        with safe_open(f, "rb") as fobj:
      File "/opt/boar/common.py", line 192, in safe_open
        return open(path, "rb")                                                                                                                                              
    IOError: [Errno 2] No such file or directory: u'/mnt/storbackup/*.jpg'
    

    Or is that another error? I'm trying to figure out how to find a file in the boar repo. Using the command boar locate --repo=MYREPO locate MYSESSION *.jpg results in the error above.

  2. Log in to comment