Skip to content

🎥 Make videos programmatically with React

add parsing of statusCode

Alex Fernandezeb68025156f1
diff --git a/packages/lambda-python/src/remotionclient.py b/packages/lambda-python/src/remotionclient.py
index 44543fe8e3..7ae24dc456 100644
--- a/packages/lambda-python/src/remotionclient.py
+++ b/packages/lambda-python/src/remotionclient.py
@@ -59,6 +59,13 @@ class RemotionClient:
result = response['Payload'].read().decode('utf-8')
print("Lambda function invoked successfully.")
print("Response:", result)
+
+ if result['statusCode'] != 200:
+ raise Exception(
+ 'Failed to invoke Lambda function'
+ )
+ return result['body']
+
except Exception as e:
print(f"Failed to invoke Lambda function: {str(e)}")