From cc01ee6c1c6055c867c2923546e47a0afab5f94f Mon Sep 17 00:00:00 2001 From: maver Date: Tue, 15 Aug 2023 19:40:22 +0200 Subject: [PATCH] Print stack to console on chatcompletion error --- public/scripts/openai.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 71b83b9f2..931cc4c38 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -806,8 +806,10 @@ function prepareOpenAIMessages({ promptManager.error = 'The name of at least one character contained whitespaces or special characters. Please check your user and character name.'; } else { toastr.error('An unknown error occurred while counting tokens. Further information may be available in console.') - chatCompletion.log('Unexpected error:'); + chatCompletion.log('----- Unexpected error while preparing prompts -----'); chatCompletion.log(error); + chatCompletion.log(error.stack); + chatCompletion.log('----------------------------------------------------'); } } finally { // Pass chat completion to prompt manager for inspection