Skip to content

Commit

Permalink
add error handling for shareable links
Browse files Browse the repository at this point in the history
  • Loading branch information
bishoy-at-pieces committed Oct 8, 2024
1 parent fb12344 commit 2d87729
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 @@ -33,10 +33,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 2d87729

Please sign in to comment.