Skip to content

Commit

Permalink
Verbose now prints Exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
steebe committed Jan 6, 2024
1 parent b387ca2 commit 5b4ef83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions releases.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v1.0.1
Adds exception message printing when the verbose flag is used.

# v1.0.0
unminipy v1: a simple executable that allows for converting minified JSON provided either thru the user's clipboard
or a local file into an unminified format.
Expand Down
8 changes: 6 additions & 2 deletions unmini.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ def main():
if cli_args.clip:
try:
unminified = json.loads(pyperclip.paste())
except:
except Exception as e:
print("No valid JSON found in clipboard")
if cli_args.verbose:
print(e)
return
elif cli_args.file:
try:
json_file = open(cli_args.file)
unminified = json.loads(json_file.read())
except:
except Exception as e:
print("File provided is not a valid JSON file")
if cli_args.verbose:
print(e)
return

unminifiedPayload = json.dumps(unminified, indent = 2)
Expand Down

0 comments on commit 5b4ef83

Please sign in to comment.