Build API: Standardize return codes.
BUG=chromium:963605
TEST=run_tests
Change-Id: If05654fe56e24425da1b89b8d516cc7ba6bebd3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1615507
Tested-by: Alex Klein <saklein@chromium.org>
Tested-by: David Burger <dburger@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
Reviewed-by: David Burger <dburger@chromium.org>
Reviewed-by: Evan Hernandez <evanhernandez@chromium.org>
diff --git a/api/controller/__init__.py b/api/controller/__init__.py
index c4c1dc4..6c70f00 100644
--- a/api/controller/__init__.py
+++ b/api/controller/__init__.py
@@ -4,3 +4,16 @@
# found in the LICENSE file.
IMPORT_PATTERN = 'chromite.api.controller.%s'
+
+# Endpoint ran successfully.
+RETURN_CODE_SUCCESS = 0
+# Unrecoverable error. This includes things from missing required inputs to
+# unhandled exceptions.
+RETURN_CODE_UNRECOVERABLE = 1
+# The endpoint did not complete successfully, but did complete via a well
+# handled path and produced actionable information relevant to the failure in
+# the response.
+RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE = 2
+# Notes the endpoint completed via a well handled path, but the result was not
+# a successful execution of the endpoint.
+RETURN_CODE_COMPLETED_UNSUCCESSFULLY = 3