civisanalytics / civis-python

Civis API Python Client
BSD 3-Clause "New" or "Revised" License
34 stars 26 forks source link

[APIC-238] Make CLI exit code nonzero when response status code != 2xx #389

Closed hinnefe2 closed 4 years ago

hinnefe2 commented 4 years ago

When using the python API client CLI tool a command which fails can still exit with a 0 exit code. This can lead Platform to mark jobs which didn't successfully complete with a green checkmark or to mistakenly progress workflows when a step didn't work.

MWE: Running

civis tables post-scan some_db_id some_schema some_table

Generates logs:

2020-05-05 04:14:37 PM code: 404
2020-05-05 04:14:37 PM error: not_found
2020-05-05 04:14:37 PM errorDescription: The requested resource could not be found.

But the job is still marked as successful.

WillRaphaelson commented 4 years ago

nice