Skip to content

Commit

Permalink
Depot bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
naitikrambhia committed Sep 26, 2024
1 parent 7e57f04 commit 9971d6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ out/
*.zip
*_pros_capture.png

venv/
*venv/
.DS_Store

*.pyc
14 changes: 12 additions & 2 deletions pros/common/sentry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import *

import click
import os
import sys

import pros.common.ui as ui

Expand Down Expand Up @@ -99,8 +101,16 @@ def restore(self, obj):

from sentry_sdk import configure_scope
with configure_scope() as scope:
scope.set_extra((key or obj.__class__.__qualname__), jsonpickle.pickler.Pickler(unpicklable=False).flatten(obj))

try:
scope.set_extra((key or obj.__class__.__qualname__), jsonpickle.pickler.Pickler(unpicklable=False).flatten(obj))
except:
if ui.confirm("Malformed depot detected, do you want to reset conductor.pros? This will remove all depots and templates. You will be unable to create a new PROS project if you do not have internet connection."):
file = os.path.join(click.get_app_dir('PROS'), 'conductor.pros')
if os.path.exists(file):
os.remove(file)
ui.echo("Conductor was reset")
sys.exit()

if override_handlers:
jsonpickle.handlers.unregister(BaseTemplate)

Expand Down

0 comments on commit 9971d6b

Please sign in to comment.