removed unwraps and added a method to Results called .unwrap_or_exit(error_message, error_code)
This tries to unwrap and if it can't then it outputs the error message with the error!() macro (log library) and exits with the error code. This is to be used instead of expect and is for fatal errors
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ def choice(choices):
|
||||
choice = int(input())
|
||||
except:
|
||||
choice = 0
|
||||
print("Invalid choice")
|
||||
print("Invalid choice, defaulting to 0")
|
||||
requests.post(api_url, json=choice);
|
||||
|
||||
# Character outputs text to the user
|
||||
|
||||
Reference in New Issue
Block a user