1
0
mirror of synced 2026-01-23 13:01:50 -05:00

go back to concise connector builder server error messages (#19609)

This commit is contained in:
Lake Mossman
2022-11-18 10:12:27 -08:00
committed by GitHub
parent dc2c61837b
commit d0860d4fd0

View File

@@ -97,7 +97,7 @@ spec:
)
)
except Exception as error:
raise HTTPException(status_code=400, detail=f"Could not list streams with with error: {str(error)}")
raise HTTPException(status_code=400, detail=f"Could not list streams with with error: {error.args[0]}")
return StreamsListRead(streams=stream_list_read)
async def read_stream(self, stream_read_request_body: StreamReadRequestBody = Body(None, description="")) -> StreamRead:
@@ -121,7 +121,7 @@ spec:
single_slice.pages.append(message_group)
except Exception as error:
# TODO: We're temporarily using FastAPI's default exception model. Ideally we should use exceptions defined in the OpenAPI spec
raise HTTPException(status_code=400, detail=f"Could not perform read with with error: {str(error)}")
raise HTTPException(status_code=400, detail=f"Could not perform read with with error: {error.args[0]}")
return StreamRead(logs=log_messages, slices=[single_slice])
@@ -199,6 +199,6 @@ spec:
def _create_low_code_adapter(manifest: Dict[str, Any]) -> LowCodeSourceAdapter:
try:
return LowCodeSourceAdapter(manifest=manifest)
except Exception as error:
except ValidationError as error:
# TODO: We're temporarily using FastAPI's default exception model. Ideally we should use exceptions defined in the OpenAPI spec
raise HTTPException(status_code=400, detail=f"Invalid connector manifest with error: {str(error)}")
raise HTTPException(status_code=400, detail=f"Invalid connector manifest with error: {error.message}")