Skip to content

Commit

Permalink
Merge pull request #194 from pieces-app/shareable-handling
Browse files Browse the repository at this point in the history
add error handling for shareable links
  • Loading branch information
bishoy-at-pieces authored Oct 9, 2024
2 parents 4bf4abe + 2d87729 commit 7d34774
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions assets/share_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ def run_async(self,asset_id=None,raw_content=None):
if sublime.ok_cancel_dialog("You need to connect to the cloud to generate a shareable link",ok_title="Connect",title="Pieces"):
self.window.run_command("pieces_allocation_connect")
return
if asset_id:
share = BasicAsset(asset_id).share()
if raw_content:
share = BasicAsset.share_raw_content(raw_content)
try:
if asset_id:
share = BasicAsset(asset_id).share()
if raw_content:
share = BasicAsset.share_raw_content(raw_content)
except:
return sublime.error_message("Unable to create a shareable link")

if self.sheet and self.update_sheet:
if self.sheet.id() in PiecesListAssetsCommand.sheets_md:
Expand Down

0 comments on commit 7d34774

Please sign in to comment.