Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that file exists before uploading to Backblaze #24

Open
grahams opened this issue Jan 26, 2021 · 0 comments
Open

Check that file exists before uploading to Backblaze #24

grahams opened this issue Jan 26, 2021 · 0 comments

Comments

@grahams
Copy link
Owner

grahams commented Jan 26, 2021

If the file on disk does not exist, we shit the bed with a stack trace. Also, a failure here should not crash the application.

Line of interest:

self.bucket.upload_local_file(

Stacktrace:

Traceback (most recent call last):
  File "./trackupdate.py", line 333, in updateTrack
    plugin.logTrack(track, startTime)
  File "/Users/grahams/src/trackupdate/plugins/BackblazeTarget.py", line 78, in logTrack
    self.bucket.upload_local_file(
  File "/usr/local/anaconda3/envs/trackupdate/lib/python3.8/site-packages/logfury/v0_1/trace_call.py", line 84, in wrapper
    return function(*wrapee_args, **wrapee_kwargs)
  File "/usr/local/anaconda3/envs/trackupdate/lib/python3.8/site-packages/b2sdk/bucket.py", line 402, in upload_local_file
    upload_source = UploadSourceLocalFile(local_path=local_file, content_sha1=sha1_sum)
  File "/usr/local/anaconda3/envs/trackupdate/lib/python3.8/site-packages/b2sdk/transfer/outbound/upload_source.py", line 84, in __init__
    raise InvalidUploadSource(local_path)
b2sdk.exception.InvalidUploadSource: Invalid upload source: /Users/grahams/Resilio Sync/Public/programme/covers/20210125.jpg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./trackupdate.py", line 381, in <module>
    trackUpdate = TrackUpdate(sys.argv[1:])
  File "./trackupdate.py", line 190, in __init__
    self.liveLoop()
  File "./trackupdate.py", line 231, in liveLoop
    self.processCurrentTrack(track)
  File "./trackupdate.py", line 318, in processCurrentTrack
    self.updateTrack(track, self.startTime)
  File "./trackupdate.py", line 335, in updateTrack
    logging.error(plugin + ": Error trying to update track")
TypeError: unsupported operand type(s) for +: 'BackblazeTarget' and 'str'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant