Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
f18ce203
Unverified
Commit
f18ce203
authored
Aug 11, 2023
by
takatost
Committed by
GitHub
Aug 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: optimize error logging (#808)
parent
b81b8637
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
agent_loop_gather_callback_handler.py
...re/callback_handler/agent_loop_gather_callback_handler.py
+2
-2
dataset_tool_callback_handler.py
api/core/callback_handler/dataset_tool_callback_handler.py
+1
-1
llm_callback_handler.py
api/core/callback_handler/llm_callback_handler.py
+1
-1
main_chain_gather_callback_handler.py
...re/callback_handler/main_chain_gather_callback_handler.py
+2
-2
indexing_runner.py
api/core/indexing_runner.py
+1
-1
No files found.
api/core/callback_handler/agent_loop_gather_callback_handler.py
View file @
f18ce203
...
@@ -85,7 +85,7 @@ class AgentLoopGatherCallbackHandler(BaseCallbackHandler):
...
@@ -85,7 +85,7 @@ class AgentLoopGatherCallbackHandler(BaseCallbackHandler):
def
on_llm_error
(
def
on_llm_error
(
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
)
->
None
:
)
->
None
:
logging
.
e
rror
(
error
)
logging
.
e
xception
(
error
)
self
.
_agent_loops
=
[]
self
.
_agent_loops
=
[]
self
.
_current_loop
=
None
self
.
_current_loop
=
None
self
.
_message_agent_thought
=
None
self
.
_message_agent_thought
=
None
...
@@ -164,7 +164,7 @@ class AgentLoopGatherCallbackHandler(BaseCallbackHandler):
...
@@ -164,7 +164,7 @@ class AgentLoopGatherCallbackHandler(BaseCallbackHandler):
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
)
->
None
:
)
->
None
:
"""Do nothing."""
"""Do nothing."""
logging
.
e
rror
(
error
)
logging
.
e
xception
(
error
)
self
.
_agent_loops
=
[]
self
.
_agent_loops
=
[]
self
.
_current_loop
=
None
self
.
_current_loop
=
None
self
.
_message_agent_thought
=
None
self
.
_message_agent_thought
=
None
...
...
api/core/callback_handler/dataset_tool_callback_handler.py
View file @
f18ce203
...
@@ -68,4 +68,4 @@ class DatasetToolCallbackHandler(BaseCallbackHandler):
...
@@ -68,4 +68,4 @@ class DatasetToolCallbackHandler(BaseCallbackHandler):
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
)
->
None
:
)
->
None
:
"""Do nothing."""
"""Do nothing."""
logging
.
e
rror
(
error
)
logging
.
e
xception
(
error
)
api/core/callback_handler/llm_callback_handler.py
View file @
f18ce203
...
@@ -96,4 +96,4 @@ class LLMCallbackHandler(BaseCallbackHandler):
...
@@ -96,4 +96,4 @@ class LLMCallbackHandler(BaseCallbackHandler):
)
)
self
.
conversation_message_task
.
save_message
(
llm_message
=
self
.
llm_message
,
by_stopped
=
True
)
self
.
conversation_message_task
.
save_message
(
llm_message
=
self
.
llm_message
,
by_stopped
=
True
)
else
:
else
:
logging
.
e
rror
(
error
)
logging
.
e
xception
(
error
)
api/core/callback_handler/main_chain_gather_callback_handler.py
View file @
f18ce203
...
@@ -72,5 +72,5 @@ class MainChainGatherCallbackHandler(BaseCallbackHandler):
...
@@ -72,5 +72,5 @@ class MainChainGatherCallbackHandler(BaseCallbackHandler):
def
on_chain_error
(
def
on_chain_error
(
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
self
,
error
:
Union
[
Exception
,
KeyboardInterrupt
],
**
kwargs
:
Any
)
->
None
:
)
->
None
:
logging
.
error
(
error
)
logging
.
exception
(
error
)
self
.
clear_chain_results
()
self
.
clear_chain_results
()
\ No newline at end of file
api/core/indexing_runner.py
View file @
f18ce203
...
@@ -549,7 +549,7 @@ class IndexingRunner:
...
@@ -549,7 +549,7 @@ class IndexingRunner:
qa_documents
.
append
(
qa_document
)
qa_documents
.
append
(
qa_document
)
format_documents
.
extend
(
qa_documents
)
format_documents
.
extend
(
qa_documents
)
except
Exception
as
e
:
except
Exception
as
e
:
logging
.
e
rror
(
str
(
e
)
)
logging
.
e
xception
(
e
)
all_qa_documents
.
extend
(
format_documents
)
all_qa_documents
.
extend
(
format_documents
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment