basic error handling skeleton is up
This commit is contained in:
parent
1d8db59738
commit
c0be5218db
6
main.js
6
main.js
|
@ -27,5 +27,9 @@ if(runidNotProvided(my_config.run_id) || !startsWithRun(my_config.run_id)){
|
||||||
const run_details = await get_run_details(my_config.base_url, process.argv.slice(2), my_config.token);
|
const run_details = await get_run_details(my_config.base_url, process.argv.slice(2), my_config.token);
|
||||||
|
|
||||||
const plan_id = run_details.data.data.relationships.plan.data.id;
|
const plan_id = run_details.data.data.relationships.plan.data.id;
|
||||||
|
console.log(`The plan ID is ${plan_id}`);
|
||||||
|
|
||||||
console.log(await create_plan_export(my_config.base_url, plan_id, my_config.token));
|
const export_response = await create_plan_export(my_config.base_url, plan_id, my_config.token);
|
||||||
|
|
||||||
|
const plan_export_id = export_response.data.data.id;
|
||||||
|
console.log(`The plan export ID is ${plan_export_id}`);
|
|
@ -54,4 +54,12 @@ const config = {
|
||||||
create_plan_export_data,
|
create_plan_export_data,
|
||||||
config
|
config
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// This will check the API response for an error.
|
||||||
|
// If one is detected, it will display the code and detail, then throw a node error.
|
||||||
|
export const check_for_error = (response_object, api_call_type) => {
|
||||||
|
if(response_object.data.errors) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue