Print stack to console on chatcompletion error

This commit is contained in:
maver 2023-08-15 19:40:22 +02:00
parent ea7268febd
commit e09a7d1e7a
1 changed files with 3 additions and 1 deletions

View File

@ -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