turbot / flowpipe

Flowpipe is a cloud scripting engine. Automation and workflow to connect your clouds to the people, systems and data that matters.
https://flowpipe.io
GNU Affero General Public License v3.0
361 stars 13 forks source link

Step `errors` attribute doesn't always have error message and code from HTTP step #215

Closed cbruno10 closed 4 months ago

cbruno10 commented 11 months ago

For instance, when using the Teams mod, if I fail to create a channel, I get the following attributes back (raw_output is an output we added that is meant to capture all attributes):

{
  "errors": [
    {
      "detail": "400 Bad Request",
      "instance": "fperr_cl06mbgcj6rth441le20",
      "status": 400,
      "title": "Bad Request",
      "type": "error_bad_request"
    }
  ],
  "flowpipe": {
    "execution_id": "exec_cl06mb8cj6rth441ldvg",
    "pipeline_execution_id": "pexec_cl06mb8cj6rth441le00",
    "status": "failed"
  },
  "raw_output": {
    "errors": [
      {
        "error": {
          "detail": "400 Bad Request",
          "instance": "fperr_cl06mbgcj6rth441le20",
          "status": 400,
          "title": "Bad Request",
          "type": "error_bad_request"
        },
        "pipeline": "teams.pipeline.create_channel",
        "pipeline_execution_id": "pexec_cl06mb8cj6rth441le00",
        "step": "http.create_channel",
        "step_execution_id": "sexec_cl06mb8cj6rth441le10"
      }
    ],
    "finished_at": "2023-10-31T02:49:18.143371Z",
    "output": {},
    "response_body": "{\"error\":{\"code\":\"BadRequest\",\"message\":\"Channel name already existed, please use other name\",\"innerError\":{\"message\":\"Channel name already existed, please use other name\",\"code\":\"NameAlreadyExists\",\"innerError\":{},\"date\":\"2023-10-31T02:49:18\",\"request-id\":\"d44e623c-ca36-45eb-944a-1ac3ecb73eba\",\"client-request-id\":\"d44e623c-ca36-45eb-944a-1ac3ecb73eba\"}}}",
    "response_headers": {
      "Client-Request-Id": "d44e623c-ca36-45eb-944a-1ac3ecb73eba",
      "Content-Type": "application/json",
      "Date": "Tue, 31 Oct 2023 02:49:17 GMT",
      "Request-Id": "d44e623c-ca36-45eb-944a-1ac3ecb73eba",
      "Strict-Transport-Security": "max-age=31536000",
      "Vary": "Accept-Encoding",
      "X-Ms-Ags-Diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"South India\",\"Slice\":\"E\",\"Ring\":\"2\",\"ScaleUnit\":\"002\",\"RoleInstance\":\"MA1PEPF000014FB\"}}"
    },
    "started_at": "2023-10-31T02:49:17.558879Z",
    "status": "400 Bad Request",
    "status_code": 400
  }
}

In the top level errors property, the message from response_body doesn't appear, but it would be helpful if it did

vhadianto commented 9 months ago

This is a question for @johnsmyth

If there's an error, should we populate the error detail with the the body of the response_body, it maybe a big content.

graza-io commented 9 months ago

In pipeline run if we pass the --verbose flag now this should provide all the outputs (including response_body).

Does this suffice?

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled for 90 days with no activity.