daytona icon indicating copy to clipboard operation
daytona copied to clipboard

HTTP Status code / error message in the API

Open idagelic opened this issue 6 months ago • 3 comments

Describe the bug The Daytona API should return correct HTTP status codes depending on what caused the issue. Right now it defaults to 500 for most of the calls. This is more apparent in some specific scenarios such as:

URI=/gitprovider/github/namespaces error="Error #01: failed to get namespaces: failed to get namespaces: GET https://api.github.com/user/orgs?page=1&p
er_page=100: 403 You need at least read:org scope or user scope to list your organizations. []\n"

where the GitHub API returned a client-side error due to missing scopes - 403 - and it gets propagated as a server side error - 500:

~$ daytona create --code
FATA[0008] 500 Internal Server Error

Expected behavior The error message and status code should be correctly propagated

Desktop (please complete the following information):

  • Daytona Version: v0.25.1

idagelic avatar Aug 19 '24 15:08 idagelic