cli icon indicating copy to clipboard operation
cli copied to clipboard

Feature request [DAB / CLI] : Return distinct error codes based on failure modes

Open iandexter opened this issue 9 months ago • 0 comments

Describe the issue

When databricks bundle run ... fails for some reason, we usually just emit a non-zero code. We should distinguish between client- and server-side errors, eg. Client.Timeout exceeded vs legit job run error.

For context: users may wrap databricks bundle commands inside scripts, and catch errors based on the return codes.

Configuration

Use the basic configuration described here: https://docs.databricks.com/en/workflows/jobs/how-to/use-bundles-with-jobs.html

Steps to reproduce the behavior

  1. Run databricks bundle run ...
  2. If there are any client timeouts, the following error will be produced: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
  3. The return code will be non-zero.

Expected Behavior

There should be distinct, following the pattern in Bash: https://tldp.org/LDP/abs/html/exitcodes.html

Actual Behavior

The error code is just usually "1".

OS and CLI version

Databricks CLI v0.218.0
Darwin KWH5QPFC9G 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64

Is this a regression?

No, it's not.

Debug Logs

No debug logs available. We just capture the return code from the shell.

iandexter avatar May 21 '24 15:05 iandexter