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

Unsuccessful requests come as empty #2

Closed
hazeliscoding opened this issue Jan 6, 2024 · 0 comments
Closed

Unsuccessful requests come as empty #2

hazeliscoding opened this issue Jan 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hazeliscoding
Copy link
Owner

hazeliscoding commented Jan 6, 2024

Issue

When a failed Query goes to Quickbase and we get a unsuccessful query, we got null for the error response. Basically QB returned 0 results but the status code was 200.

How to Reproduce

Create a request that you know will return 0 results in Quickbase.

{
  "data": [],
  "fields": [
    {
      "id": 1,
      "label": "Date Created",
      "type": "timestamp"
    },
    {
      "id": 2,
      "label": "Date Modified",
      "type": "timestamp"
    },
    {
      "id": 3,
      "label": "Record ID#",
      "type": "recordid"
    }
  ],
  "metadata": {
    "numFields": 3,
    "numRecords": 0,
    "skip": 0,
    "totalRecords": 0
  }
}

Then try to use it like normal.

// Let' say this query will fail and isSuccess will be false
var (response, errorResponse, isSuccess) = await quickbaseClient.QueryRecords(qbQuery);

// errorResponse is null! So then this will almost act like a succesful query! not good... 
@hazeliscoding hazeliscoding added the bug Something isn't working label Jan 6, 2024
hazeliscoding pushed a commit that referenced this issue Jan 23, 2024
…Client (#2)

- Modify the QueryRecords method to handle different types of errors more explicitly, including client errors, server errors, and generic failures.
- Introduce additional checks for empty data in the QueryRecords method, returning a specific 'NotFound' error if no records are found.
- Update InsertRecords and UpdateRecords methods for consistent error handling and response processing.
- Improve overall readability and maintainability of the QuickbaseClient class.

NOTE: These changes may affect how client errors and empty query results are handled, requiring adjustments in client code.
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