Skip to content

Commit

Permalink
fix config update error output
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <[email protected]>
  • Loading branch information
fjogeleit committed Oct 6, 2024
1 parent 46e3792 commit b48e4a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27445,7 +27445,7 @@ const convertToJSON = (value) => {
*
* @returns {FormData}
*/
const convertToFormData = (data, files, convertPaths) => {
const convertToFormData = (data, files) => {
const formData = new FormData();

for (const [key, value] of Object.entries(data)) {
Expand Down Expand Up @@ -27666,7 +27666,9 @@ const updateConfig = async (instanceConfig, formData, actions) => {
}
}
} catch(error) {
actions.setFailed({ message: `Unable to read Content-Length: ${error.message}`, data, files })
const data = {}
formData.forEach((k, v) => { data[k] = v })
actions.setFailed(JSON.stringify({ message: `Unable to read Content-Length: ${error.message}`, formData: data }))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const convertToJSON = (value) => {
*
* @returns {FormData}
*/
const convertToFormData = (data, files, convertPaths) => {
const convertToFormData = (data, files) => {
const formData = new FormData();

for (const [key, value] of Object.entries(data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/httpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const updateConfig = async (instanceConfig, formData, actions) => {
}
}
} catch(error) {
actions.setFailed({ message: `Unable to read Content-Length: ${error.message}`, data, files })
actions.setFailed(JSON.stringify({ message: `Unable to read Content-Length: ${error.message}` }))
}
}

Expand Down

0 comments on commit b48e4a7

Please sign in to comment.