Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
probablykabari opened this issue Dec 13, 2024 · 0 comments
Open

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

probablykabari opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@probablykabari
Copy link

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 probablykabari added the bug Something isn't working label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant