Skip to content

Commit 94e073f

Browse files
committed
add airbyte_cdk.connector_builder.main:run
1 parent 70f7f43 commit 94e073f

File tree

1 file changed

+12
-2
lines changed
  • airbyte_cdk/connector_builder

1 file changed

+12
-2
lines changed

airbyte_cdk/connector_builder/main.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,23 @@ def handle_request(args: List[str]) -> str:
9696
handle_connector_builder_request(source, command, config, catalog, state, limits)
9797
)
9898

99+
def run(args: list[str] | None) -> None:
100+
"""Run the connector builder handler."""
101+
if args is None:
102+
args = sys.argv[1:]
99103

100-
if __name__ == "__main__":
101104
try:
102-
print(handle_request(sys.argv[1:]))
105+
result = handle_request(args)
106+
print(result)
103107
except Exception as exc:
104108
error = AirbyteTracedException.from_exception(
105109
exc, message=f"Error handling request: {str(exc)}"
106110
)
107111
m = error.as_airbyte_message()
108112
print(ab_message_to_string(m))
113+
sys.exit(1)
114+
115+
116+
if __name__ == "__main__":
117+
run(sys.argv[1:])
118+
sys.exit(1)

0 commit comments

Comments
 (0)