helicone icon indicating copy to clipboard operation
helicone copied to clipboard

[Bug]: Improperly Formatted Error from API Call

Open probablykabari opened this issue 2 months ago • 0 comments

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

probablykabari avatar Dec 13 '24 17:12 probablykabari