Uploaded image for project: 'Qt Cloud'
  1. Qt Cloud
  2. CLOUD-561

Use standard HTTPException instead of hacking into JSONresponse.

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P1: Critical
    • None
    • None
    • Backend
    • None

    Description

      For example: 

       

      this_api_response = Tools.createResponseOBJ(201, json_content=on_success_json)
                          else:
                              this_api_response = Tools.createResponseOBJ(400, {"status": "Failed", "message": "Cannot create user"})
       

       

       

      can be replaced with: 

      raise HTTPException(status_code=400, detail="Cannot create user") # or provide dict in `detail` and it would be JSONed automatically
       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            as33ms Aseem Shakuntal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: