Skip to content

invoke_error is not callable #15554

Closed

Description

@jiangbo721

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.1

Cloud or Self Hosted

Cloud

Steps to reproduce

return invoke_error(description=f"[{self.provider_name}] {invoke_error.description}, {str(error)}")

invoke_error is not callable

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Activity

  1. added
    cloud
    🐞 bug
    on Mar 12, 2025
  2. dosubot commented on Mar 12, 2025

    @dosubot

    The issue you're encountering, "invoke_error is not callable," likely arises from a misunderstanding of how invoke_error is used in the code. In the ai_model.py file, invoke_error is not a function but rather part of a class structure related to error handling.

    The InvokeError class and its subclasses (such as InvokeAuthorizationError, InvokeConnectionError, etc.) are used to represent different types of errors. These are not callable functions but rather exception classes that are instantiated and raised when specific errors occur [1].

    If you are trying to handle or raise an error, you should instantiate the appropriate error class, like so:

    raise InvokeError("Description of the error")

    If you need to transform an error, you should use the _transform_invoke_error method, which maps specific errors to these unified error types [2].

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cloud🐞 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions