MCPcopy Index your code
hub / github.com/zappa/Zappa / format_lambda_response

Method format_lambda_response

zappa/cli.py:1599–1613  ·  view source on GitHub ↗
(self, response, colorize=True)

Source from the content-addressed store, hash-verified

1597 raise ClickException("{} error occurred while invoking command.".format(response["FunctionError"]))
1598
1599 def format_lambda_response(self, response, colorize=True):
1600 if "LogResult" in response:
1601 logresult_bytes = base64.b64decode(response["LogResult"])
1602 try:
1603 decoded = logresult_bytes.decode()
1604 except UnicodeDecodeError:
1605 return logresult_bytes
1606 else:
1607 if colorize and sys.stdout.isatty():
1608 formatted = self.format_invoke_command(decoded)
1609 return self.colorize_invoke_command(formatted)
1610 else:
1611 return decoded
1612 else:
1613 return response
1614
1615 def format_invoke_command(self, string):
1616 """

Callers 2

invokeMethod · 0.95

Calls 2

format_invoke_commandMethod · 0.95

Tested by 1