Skip to content

[Bug]: Improperly Formatted Error from API Call #3057

@probablykabari

Description

@probablykabari

What happened?

This request causes the API to return an html error response instead of the validation error. I figured out it was missing some parameters but the error message itself is a bug.

The Request

curl --request POST \
  --url https://api.helicone.ai/v1/user/metrics/query \
  --header 'Content-Type: application/json' \
  --header 'authorization: <my-api-key>' \
  --data '{
  "filter": {
    "request_response_rmt": {
      "user_id": {
        "equals": "17"
      }
    }
  }
}'

The Error

This is returned in the "error" property of the response.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>ValidateError<br> &nbsp; &nbsp;at ExpressTemplateService.getValidatedArgs (/usr/src/app/valhalla/jawn/node_modules/@tsoa/runtime/dist/routeGeneration/templates/express/expressTemplateService.js:70:19)<br> &nbsp; &nbsp;at UserController_getUserMetrics (/usr/src/app/valhalla/jawn/dist/valhalla/jawn/src/tsoa-build/public/routes.js:3624:45)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/usr/src/app/valhalla/jawn/node_modules/express/lib/router/layer.js:95:5)<br> &nbsp; &nbsp;at next (/usr/src/app/valhalla/jawn/node_modules/express/lib/router/route.js:149:13)<br> &nbsp; &nbsp;at runAuthenticationMiddleware (/usr/src/app/valhalla/jawn/dist/valhalla/jawn/src/tsoa-build/public/routes.js:7204:17)<br> &nbsp; &nbsp;at process.processTicksAndRejections (node:internal/process/task_queues:95:5)</pre>
</body>
</html>

Relevant log output

No response

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions