| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a26f918 commit d703477
35 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ public async Task<bool> MigrateLatestStates(int batchSize = 100, int errorLimit | |||
| 53 | 53 | #if DEBUG | |
| 54 | 54 | Console.WriteLine($"\r\n{error}\r\n"); | |
| 55 | 55 | #else | |
| 56 | - _logger.LogError($"{error}"); | ||
| 56 | + _logger.LogError(ex, $"{error}"); | ||
| 57 | 57 | #endif | |
| 58 | 58 | } | |
| 59 | 59 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,7 +66,7 @@ await hook.OnResponseGenerated(new InstructResponseModel | |||
| 66 | 66 | } | |
| 67 | 67 | catch (Exception ex) | |
| 68 | 68 | { | |
| 69 | - _logger.LogError($"Error when analyzing pdf in file service: {ex.Message}\r\n{ex.InnerException}"); | ||
| 69 | + _logger.LogError(ex, $"Error when analyzing pdf in file service."); | ||
| 70 | 70 | return content; | |
| 71 | 71 | } | |
| 72 | 72 | finally | |
@@ -113,7 +113,7 @@ private async Task<IEnumerable<string>> DownloadFiles(string dir, List<InstructF | |||
| 113 | 113 | } | |
| 114 | 114 | catch (Exception ex) | |
| 115 | 115 | { | |
| 116 | - _logger.LogWarning($"Error when saving pdf file: {ex.Message}\r\n{ex.InnerException}"); | ||
| 116 | + _logger.LogWarning(ex, $"Error when saving pdf file."); | ||
| 117 | 117 | continue; | |
| 118 | 118 | } | |
| 119 | 119 | } | |
@@ -141,7 +141,7 @@ private async Task<IEnumerable<string>> ConvertPdfToImages(IEnumerable<string> f | |||
| 141 | 141 | } | |
| 142 | 142 | catch (Exception ex) | |
| 143 | 143 | { | |
| 144 | - _logger.LogWarning($"Error when converting pdf file to images ({file}): {ex.Message}\r\n{ex.InnerException}"); | ||
| 144 | + _logger.LogWarning(ex, $"Error when converting pdf file to images ({file})."); | ||
| 145 | 145 | continue; | |
| 146 | 146 | } | |
| 147 | 147 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -108,7 +108,7 @@ private async Task<IEnumerable<MessageFileModel>> SelectFiles(IEnumerable<Messag | |||
| 108 | 108 | } | |
| 109 | 109 | catch (Exception ex) | |
| 110 | 110 | { | |
| 111 | - _logger.LogWarning($"Error when selecting files. {ex.Message}\r\n{ex.InnerException}"); | ||
| 111 | + _logger.LogWarning(ex, $"Error when selecting files."); | ||
| 112 | 112 | return new List<MessageFileModel>(); | |
| 113 | 113 | } | |
| 114 | 114 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ public bool SaveSpeechFile(string conversationId, string fileName, BinaryData da | |||
| 24 | 24 | } | |
| 25 | 25 | catch (Exception ex) | |
| 26 | 26 | { | |
| 27 | - _logger.LogWarning($"Error when saving speech file. {fileName} ({conversationId})\r\n{ex.Message}\r\n{ex.InnerException}"); | ||
| 27 | + _logger.LogWarning(ex, $"Error when saving speech file. {fileName} (conv id: {conversationId})"); | ||
| 28 | 28 | return false; | |
| 29 | 29 | } | |
| 30 | 30 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -153,7 +153,7 @@ public bool SaveMessageFiles(string conversationId, string messageId, string sou | |||
| 153 | 153 | } | |
| 154 | 154 | catch (Exception ex) | |
| 155 | 155 | { | |
| 156 | - _logger.LogWarning($"Error when saving message file {file.FileName}: {ex.Message}\r\n{ex.InnerException}"); | ||
| 156 | + _logger.LogWarning(ex, $"Error when saving message file {file.FileName} (conv id: {conversationId})."); | ||
| 157 | 157 | continue; | |
| 158 | 158 | } | |
| 159 | 159 | } | |
@@ -333,7 +333,7 @@ private async Task<IEnumerable<MessageFileModel>> GetScreenshots(string file, st | |||
| 333 | 333 | } | |
| 334 | 334 | catch (Exception ex) | |
| 335 | 335 | { | |
| 336 | - _logger.LogWarning($"Error when getting message file screenshots {file} (messageId: {messageId}), Error: {ex.Message}\r\n{ex.InnerException}"); | ||
| 336 | + _logger.LogWarning(ex, $"Error when getting message file screenshots {file} (messageId: {messageId})"); | ||
| 337 | 337 | return files; | |
| 338 | 338 | } | |
| 339 | 339 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,9 +31,8 @@ public bool SaveKnowledgeBaseFile(string collectionName, string vectorStoreProvi | |||
| 31 | 31 | } | |
| 32 | 32 | catch (Exception ex) | |
| 33 | 33 | { | |
| 34 | - _logger.LogWarning($"Error when saving knowledge file " + | ||
| 35 | - $"(Vector store provider: {vectorStoreProvider}, Collection: {collectionName}, File name: {fileName})." + | ||
| 36 | - $"\r\n{ex.Message}\r\n{ex.InnerException}"); | ||
| 34 | + _logger.LogWarning(ex, $"Error when saving knowledge file " + | ||
| 35 | + $"(Vector store provider: {vectorStoreProvider}, Collection: {collectionName}, File name: {fileName})."); | ||
| 37 | 36 | return false; | |
| 38 | 37 | } | |
| 39 | 38 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ public bool SaveUserAvatar(FileDataModel file) | |||
| 40 | 40 | } | |
| 41 | 41 | catch (Exception ex) | |
| 42 | 42 | { | |
| 43 | - _logger.LogWarning($"Error when saving user avatar: {ex.Message}\r\n{ex.InnerException}"); | ||
| 43 | + _logger.LogWarning(ex, $"Error when saving user avatar (user id: {_user.Id})"); | ||
| 44 | 44 | return false; | |
| 45 | 45 | } | |
| 46 | 46 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ await hook.OnResponseGenerated(new InstructResponseModel | |||
| 84 | 84 | catch (Exception ex) | |
| 85 | 85 | { | |
| 86 | 86 | var error = $"Error when getting agent {agent.Name} instruction response."; | |
| 87 | - _logger.LogWarning($"{error} {ex.Message}\r\n{ex.InnerException}"); | ||
| 87 | + _logger.LogWarning(ex, $"{error} (template name: {templateName})"); | ||
| 88 | 88 | return error; | |
| 89 | 89 | } | |
| 90 | 90 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,7 +45,7 @@ public partial class InstructService | |||
| 45 | 45 | } | |
| 46 | 46 | catch (Exception ex) | |
| 47 | 47 | { | |
| 48 | - _logger.LogWarning($"Error when getting ai response, {ex.Message}\r\n{ex.InnerException}"); | ||
| 48 | + _logger.LogWarning(ex, $"Error when getting ai response"); | ||
| 49 | 49 | } | |
| 50 | 50 | ||
| 51 | 51 | return result; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ public bool UpsertCrontabItem(CrontabItem cron) | |||
| 26 | 26 | } | |
| 27 | 27 | catch (Exception ex) | |
| 28 | 28 | { | |
| 29 | - _logger.LogError($"Error when saving crontab item: {ex.Message}\r\n{ex.InnerException}"); | ||
| 29 | + _logger.LogError(ex, $"Error when saving crontab item (agent id: {cron.AgentId}, conv id: {cron.ConversationId})."); | ||
| 30 | 30 | return false; | |
| 31 | 31 | } | |
| 32 | 32 | } | |
@@ -57,7 +57,7 @@ public bool DeleteCrontabItem(string conversationId) | |||
| 57 | 57 | } | |
| 58 | 58 | catch (Exception ex) | |
| 59 | 59 | { | |
| 60 | - _logger.LogError($"Error when deleting crontab item (${conversationId}): {ex.Message}\r\n{ex.InnerException}"); | ||
| 60 | + _logger.LogError(ex, $"Error when deleting crontab item (conv id: {conversationId})."); | ||
| 61 | 61 | return false; | |
| 62 | 62 | } | |
| 63 | 63 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments