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

🐛 Handle empty AskError detail object #1616

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

sadlowskij
Copy link
Contributor

Proposed Changes

Sometimes the detail property in a ask error (e. g. of a deploy) can be just an empty object. This happens for example, if I try to deploy while the build is still going on. It throws a 409 with an empty detail:
image

This will lead to an error, trying to access payload.detail.response.message. This error then is being caught here which leads to the whole json bein output, instead of the message being retrieved:
image

With this fix it will correctly be retrieved:
image

I worked on this before the other change to getAskError was merged (which catches errors in the ask error retrieval process). Before this merge, the error was more severe as it completely dropped the actual error message, now it is more of a question of how it is displayed. However this still throws an error currently in a place where it is avoidable.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@jankoenig jankoenig self-requested a review January 30, 2024 11:29
Copy link
Member

@jankoenig jankoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @sadlowskij!

@jankoenig jankoenig merged commit 8e9f578 into jovotech:v4/dev Jan 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants