jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.67k stars 310 forks source link

:bug: Handle empty AskError detail object #1616

Closed sadlowskij closed 5 months ago

sadlowskij commented 5 months ago

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

Checklist