Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavyaroslav committed Feb 21, 2023
2 parents 734baa4 + dba8c26 commit 6243a6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"command": "edit_settings",
"args": {
"base_file": "${packages}/OpenAI completion/openAI.sublime-settings",
"default": "// Settings in here override those in \"openAI/openAI.sublime-settings\"\n{\n\t$0\n}\n"
"default": "// Settings in here override those in \"OpenAI completion/openAI.sublime-settings\"\n{\n\t\"token\": \"$0\"\n}\n"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def exec_net_request(self, connect: http.client.HTTPSConnection):
try:
res = connect.getresponse()
data = res.read()
status = res.status
data_decoded = data.decode('utf-8')
connect.close()
completion = json.loads(data_decoded)['choices'][0]['text']
Expand All @@ -70,8 +71,7 @@ def exec_net_request(self, connect: http.client.HTTPSConnection):
return

except Exception as ex:
sublime.error_message("Error\n" + str(ex))
logging.exception("Exception: " + str(ex))
sublime.error_message(f"Server Error: {str(status)}\n{ex}")
return

def complete(self):
Expand Down

0 comments on commit 6243a6b

Please sign in to comment.