OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

modify all api response to the same format (JSONResponse with status_code and content set)

Open assertion opened this issue 1 year ago • 0 comments

Thanks for @Umpire2018 's suggestion, cc @rbren , modify the response format to the same like

# success:
return JSONResponse(
        status_code=status.HTTP_200_OK,
        content=models,
    )
# failed:
return JSONResponse(
            status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
            content={'error': error_msg},
        )

previous pr: https://github.com/OpenDevin/OpenDevin/pull/1158

assertion avatar Apr 17 '24 02:04 assertion