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

fix: fix human_readable for good #1135

Merged
merged 3 commits into from
May 1, 2024
Merged

Conversation

Mishura4
Copy link
Member

Example:

{
  "message": "Invalid Form Body",
  "code": 50035,
  "errors": {
    "data": {
      "poll": {
        "_errors": [
          {"code": "POLL_TYPE_QUESTION_ALLOWS_TEXT_ONLY", "message": "This poll type cannot include attachments, emoji or stickers with the question"}
        ]
      }
    }
  }
}

Currently the code assumes a _errors object either at the first or second level, this one is at the third level, so it wouldn't parse. This PR fixes that and adds handling of errors without an array: Error: 50035: Invalid Form Body - data.poll: This poll type cannot include attachments, emoji or stickers with the question (POLL_TYPE_QUESTION_ALLOWS_TEXT_ONLY)

Code change checklist

  • I have ensured that all methods and functions are fully documented using doxygen style comments.
  • My code follows the coding style guide.
  • I tested that my change works before raising the PR.
  • I have ensured that I did not break any existing API calls.
  • I have not built my pull request using AI, a static analysis tool or similar without any human oversight.

@Mishura4 Mishura4 changed the base branch from master to dev April 30, 2024 21:21
Copy link

netlify bot commented Apr 30, 2024

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit dcd448f
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/6631a28669af8d00085e0cb9
😎 Deploy Preview https://deploy-preview-1135--dpp-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the code Improvements or additions to code. label Apr 30, 2024
Copy link
Contributor

Thank you for your contribution, but PRs must be raised against the dev branch. Please log your pull request against the dev branch not master. You can also retarget this pull request, then reopen it.

@github-actions github-actions bot closed this Apr 30, 2024
@Mishura4 Mishura4 reopened this Apr 30, 2024
@Mishura4
Copy link
Member Author

This might cause conflicts with #1126 but only because of indentation

@Mishura4 Mishura4 marked this pull request as draft April 30, 2024 21:26
@Mishura4 Mishura4 changed the title fix: fix uncaught json exception on some REST errors fix: fix human_readable for good May 1, 2024
@Mishura4
Copy link
Member Author

Mishura4 commented May 1, 2024

This will now flat out just conflict with #1126

@Mishura4 Mishura4 marked this pull request as ready for review May 1, 2024 03:21
@braindigitalis braindigitalis merged commit 56b6b07 into brainboxdotcc:dev May 1, 2024
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Improvements or additions to code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants