Skip to content

Commit

Permalink
fix: profile_save.py: print to error
Browse files Browse the repository at this point in the history
  • Loading branch information
bananabr3d committed Mar 14, 2024
1 parent 127b7ac commit 9612e86
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Client/profile_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_profile(self, profile_uuid):
if profile["profile_uuid"] == profile_uuid:
return profile
except:
print("json error: Make sure profiles.json is formatted correctly")
raise RuntimeError("json error: Make sure profiles.json is formatted correctly")
return None

def set_profile(self, profile_uuid, profile_name, profile_color):
Expand All @@ -73,7 +73,7 @@ def set_profile(self, profile_uuid, profile_name, profile_color):
with open(self.path, 'w') as file:
json.dump(data, file)
except:
print("json error: Make sure profiles.json is formatted correctly")
raise RuntimeError("json error: Make sure profiles.json is formatted correctly")
return None

def get_profile_by_name(self, profile_name):
Expand Down Expand Up @@ -110,7 +110,7 @@ def add_new_profile(self, profile_name, profile_uuid, profile_color):
json.dump(data, file)
file.truncate()
except:
print("json error: Make sure profiles.json is formatted correctly")
raise RuntimeError("json error: Make sure profiles.json is formatted correctly")

else:
with open(self.path, 'w') as file:
Expand All @@ -135,7 +135,7 @@ def delete_profile(self, profile_uuid):
with open(self.path, 'w') as file:
json.dump(data, file)
except:
print("json error: Make sure profiles.json is formatted correctly")
raise RuntimeError("json error: Make sure profiles.json is formatted correctly")

def delete_profile_by_name(self, profile_name):
"""
Expand All @@ -155,7 +155,7 @@ def delete_profile_by_name(self, profile_name):
with open(self.path, 'w') as file:
json.dump(data, file)
except:
print("json error: Make sure profiles.json is formatted correctly")
raise RuntimeError("json error: Make sure profiles.json is formatted correctly")

def delete_all_profiles(self):
"""
Expand Down

0 comments on commit 9612e86

Please sign in to comment.