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

Show axios error reason with JSON (v5) #670

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ Format:
e.g. `alkiln-setup`, `alkiln-run`, `alkiln-takedown`
- don't print the ["publish this cucumber report" message](https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#options)


## [4.11.1] - 2023-03-21
### Changed
- Get error data from server errors

## [4.11.0] - 2023-03-13
### Changed
- Shorten Axios errors to make them more readable (https://github.com/SuffolkLITLab/ALKiln/pull/632)
Expand Down
12 changes: 6 additions & 6 deletions lib/docassemble/docassemble_api_REST.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ da.get_dev_id = async function ( timeout ) {
try {
return await axios.request( options );
} catch (error) {
throw error.toJSON();
throw {...error.toJSON(), data: error.response?.data};
}
}; // Ends da.get_dev_id()

Expand All @@ -48,7 +48,7 @@ da.create_project = async function ( project_name, timeout ) {
try {
return await axios.request( options );
} catch (error) {
throw error.toJSON();
throw {...error.toJSON(), data: error.response?.data};
}
}; // Ends da.create_project()

Expand All @@ -71,7 +71,7 @@ da.pull = async function ( timeout ) {
try {
return await axios.request( options );
} catch (error) {
throw error.toJSON();
throw {...error.toJSON(), data: error.response?.data};
}
}; // Ends da.pull()

Expand All @@ -92,7 +92,7 @@ da.has_task_finished = async function ( task_id, timeout ) {
try {
return await axios.request( options );
} catch (error) {
throw error.toJSON();
throw {...error.toJSON(), data: error.response?.data};
}
}; // Ends da.has_task_finished()

Expand All @@ -113,7 +113,7 @@ da.delete_project = async function ( timeout ) {
try {
return await axios.request( options );
} catch (error) {
throw error.toJSON();
throw {...error.toJSON(), data: error.response?.data};
}
}; // Ends da.delete_project()

Expand Down Expand Up @@ -142,7 +142,7 @@ da.__delete_projects_starting_with = async function ( base_name, starting_num=1,

await axios.request( options );
} catch ( error ) {
console.log( error.toJSON() )
console.log( {...error.toJSON(), data: error.response?.data});
}
name_incrementor++;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@suffolklitlab/alkiln",
"version": "4.11.0",
"version": "4.11.1",
"description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.",
"main": "lib/index.js",
"scripts": {
Expand Down