@halix/action-sdk
    Preparing search index...

    Function prepareErrorResponse

    • prepareErrorResponse prepares an error response in the appropriate format. The action handler should return an ErrorResponse response when the action is not successful. If useBody is true, the response will be returned as an object with the HTTP response code and the ErrorResponse in the body field. If useBody is false, the ErrorResponse will be returned directly.

      Parameters

      • errorMessage: string

        The error message

      Returns ErrorResponse | { body: string; statusCode: number }

      Formatted error response; an ErrorResponse unless useBody is true